This repository was archived by the owner on Nov 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +38
-14
lines changed
docs/.vuepress/components Expand file tree Collapse file tree 3 files changed +38
-14
lines changed Original file line number Diff line number Diff line change 3
3
:class =" classes"
4
4
class =" mdc-fab"
5
5
v-on =" $listeners" >
6
- <slot />
6
+ <slot name =" icon" />
7
+ <div
8
+ v-if =" extended"
9
+ class =" mdc-fab__label" >
10
+ <slot />
11
+ </div >
7
12
</button >
8
13
</template >
9
14
@@ -26,6 +31,10 @@ export default {
26
31
exited: {
27
32
type: Boolean ,
28
33
default: false
34
+ },
35
+ extended: {
36
+ type: Boolean ,
37
+ default: false
29
38
}
30
39
},
31
40
data () {
@@ -39,7 +48,8 @@ export default {
39
48
return {
40
49
' mdc-fab--mini' : this .mini ,
41
50
' mdc-fab--absolute-right' : this .absoluteRight ,
42
- ' mdc-fab--exited' : this .exited
51
+ ' mdc-fab--exited' : this .exited ,
52
+ ' mdc-fab--extended' : this .extended
43
53
}
44
54
}
45
55
},
@@ -68,8 +78,8 @@ export default {
68
78
},
69
79
methods: {
70
80
updateSlot () {
71
- if (this .$slots .default ) {
72
- this .$slots .default .map (n => {
81
+ if (this .$slots .icon ) {
82
+ this .$slots .icon .map (n => {
73
83
if (n .elm .tagName .toUpperCase () !== ' SVG' ) {
74
84
n .elm .classList .add (' mdc-fab__icon' )
75
85
}
Original file line number Diff line number Diff line change 3
3
### Markup
4
4
5
5
``` html
6
- <m-fab mini absoluteRight >
7
- <m-icon icon =" favorite" @click =" ..." />
6
+ <m-fab
7
+ mini
8
+ absoluteRight >
9
+ <m-icon
10
+ slot =" icon"
11
+ icon =" favorite"
12
+ @click =" ..." />
8
13
</m-fab >
9
14
<m-fab >
10
- <svg @click =" ..." />
15
+ <svg
16
+ slot =" icon"
17
+ @click =" ..." />
11
18
</m-fab >
12
19
```
13
20
### Props
17
24
| mini | Boolean | false | mini fab button |
18
25
| absoluteRight | Boolean | false | whether the fab should be rendered on the bottom right |
19
26
| exited | Boolean | false | animates the fab out of view |
27
+ | extended | Boolean | false | extended fab with label |
20
28
21
29
Events are mapped to the inner button element.
22
30
23
31
### Slots
24
32
25
33
| Slot | Description |
26
34
| ------| -------------|
27
- | default | icon component |
35
+ | default | extended fab label |
36
+ | icon | icon component |
28
37
29
38
### Reference
30
39
Original file line number Diff line number Diff line change 2
2
<div >
3
3
<ComponentSection >
4
4
<m-fab
5
- :mini =" checkboxProps[0].value"
6
- :absoluteRight =" checkboxProps[1].value"
7
- :exited =" checkboxProps[2].value" >
8
- <m-icon icon =" create" />
5
+ :mini =" radioProps[2].value"
6
+ :absoluteRight =" checkboxProps[0].value"
7
+ :exited =" checkboxProps[1].value"
8
+ :extended =" radioProps[1].value" >
9
+ <m-icon
10
+ slot =" icon"
11
+ icon =" create" />
12
+ <span v-if =" radioProps[1].value" >Write something</span >
9
13
</m-fab >
10
14
</ComponentSection >
11
15
<ComponentProps
@@ -19,10 +23,11 @@ export default {
19
23
data () {
20
24
return {
21
25
radioProps: [
22
- { prop: ' baseline' , value: true }
26
+ { prop: ' baseline' , value: true },
27
+ { prop: ' extended' , value: false },
28
+ { prop: ' mini' , value: false }
23
29
],
24
30
checkboxProps: [
25
- { prop: ' mini' , value: false },
26
31
{ prop: ' absoluteRight' , value: false },
27
32
{ prop: ' exited' , value: false }
28
33
]
You can’t perform that action at this time.
0 commit comments