Skip to content

Commit

Permalink
feat(switch): allow custom label markup with default slot
Browse files Browse the repository at this point in the history
  • Loading branch information
stasson committed Jan 7, 2018
1 parent 2365895 commit e89a618
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions components/switch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ var vm = new Vue({
})
```

> or use default slot for label
```html
<mdc-switch v-model="checked">{{Label}}</mdc-switch>
```

### props

| props | Type | Default | Description |
Expand Down
2 changes: 1 addition & 1 deletion components/switch/mdc-switch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="mdc-switch__knob"></div>
</div>
</div>
<label :for="_uid" v-if="label">{{ label }}</label>
<label ref="label" :for="_uid"><slot>{{label}}</slot></label>
</div>
</template>

Expand Down

0 comments on commit e89a618

Please sign in to comment.