ui-template-muc
Version:
A fantastic mobile ui lib implement by Vue
27 lines (26 loc) • 436 B
JavaScript
//组件挂载,显示隐藏
let visibleMixin = {
data: function () {
return {
isVisible: true
}
},
watch: {
isVisible (newVal) {
if (!newVal) {
this.$emit('hook:remove')
}
}
},
methods: {
show () {
this.isVisible = true
return this
},
hide () {
this.isVisible = false
return this
}
}
}
export default visibleMixin