diff --git a/components/fab/Fab.vue b/components/fab/Fab.vue index 4d9b27be2..6591781a0 100644 --- a/components/fab/Fab.vue +++ b/components/fab/Fab.vue @@ -3,7 +3,12 @@ :class="classes" class="mdc-fab" v-on="$listeners"> - + +
+ +
@@ -26,6 +31,10 @@ export default { exited: { type: Boolean, default: false + }, + extended: { + type: Boolean, + default: false } }, data () { @@ -39,7 +48,8 @@ export default { return { 'mdc-fab--mini': this.mini, 'mdc-fab--absolute-right': this.absoluteRight, - 'mdc-fab--exited': this.exited + 'mdc-fab--exited': this.exited, + 'mdc-fab--extended': this.extended } } }, @@ -68,8 +78,8 @@ export default { }, methods: { updateSlot () { - if (this.$slots.default) { - this.$slots.default.map(n => { + if (this.$slots.icon) { + this.$slots.icon.map(n => { if (n.elm.tagName.toUpperCase() !== 'SVG') { n.elm.classList.add('mdc-fab__icon') } diff --git a/components/fab/README.md b/components/fab/README.md index 6e2943624..49b44f481 100644 --- a/components/fab/README.md +++ b/components/fab/README.md @@ -3,11 +3,18 @@ ### Markup ```html - - + + - + ``` ### Props @@ -17,6 +24,7 @@ | mini | Boolean | false | mini fab button | | absoluteRight | Boolean | false | whether the fab should be rendered on the bottom right | | exited | Boolean | false | animates the fab out of view | +| extended | Boolean | false | extended fab with label | Events are mapped to the inner button element. @@ -24,7 +32,8 @@ Events are mapped to the inner button element. | Slot | Description | |------|-------------| -| default | icon component | +| default | extended fab label | +| icon | icon component | ### Reference diff --git a/docs/.vuepress/components/FabDemo.vue b/docs/.vuepress/components/FabDemo.vue index 531b417a6..b426f74a0 100644 --- a/docs/.vuepress/components/FabDemo.vue +++ b/docs/.vuepress/components/FabDemo.vue @@ -2,10 +2,14 @@
- + :mini="radioProps[2].value" + :absoluteRight="checkboxProps[0].value" + :exited="checkboxProps[1].value" + :extended="radioProps[1].value"> + + Write something