chore(tree): add props icon

This commit is contained in:
07akioni 2019-12-24 22:20:59 +08:00
parent 9c67b78b64
commit 3eeb5a8802

View File

@ -32,6 +32,10 @@ export default {
checked: {
type: Boolean,
default: false
},
icon: {
type: Function,
default: null
}
},
methods: {
@ -101,7 +105,9 @@ export default {
}, [
this.data.label
]),
this.$slots.default
(
this.icon && typeof this.icon === 'function' ? [this.icon()] : []
).concat(this.$slots.default)
])
}
}