Skip to content

Commit

Permalink
feat(MdDatepicker): add support for labels (#1265)
Browse files Browse the repository at this point in the history
* feat(MdDatepicker): add label style

* docs(MdDatepicker): add example with label

* fix(MdDatepicker): remove px unit
  • Loading branch information
Samuell1 authored and marcosmoura committed Dec 6, 2017
1 parent ef720c4 commit 9f61c0b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/app/pages/Components/Datepicker/Datepicker.vue
@@ -1,4 +1,5 @@
<example src="./examples/BasicDatepicker.vue" />
<example src="./examples/LabeledDatepicker.vue" />
<example src="./examples/CancelOpenDatepicker.vue" />
<example src="./examples/DisabledDatesDatepicker.vue" />

Expand All @@ -13,6 +14,8 @@
<h2>Datepicker</h2>

<code-example title="Basic Example" :component="examples['basic-datepicker']" />

<code-example title="Labeled Example" :component="examples['labeled-datepicker']" />
</div>

<div class="page-container-section">
Expand Down
@@ -0,0 +1,16 @@
<template>
<div>
<md-datepicker v-model="selectedDate">
<label>Select date</label>
</md-datepicker>
</div>
</template>

<script>
export default {
name: 'LabeledDatepicker',
data: () => ({
selectedDate: null
})
}
</script>
3 changes: 3 additions & 0 deletions src/components/MdDatepicker/MdDatepicker.vue
Expand Up @@ -116,6 +116,9 @@
}
.md-datepicker {
label {
top: 0 !important;
}
.md-date-icon {
cursor: pointer;
}
Expand Down

0 comments on commit 9f61c0b

Please sign in to comment.