/** * 顶部header */ Vue.component("screen-select", { template: `
`, props: { data:{ type:Array }, def:{ type:Object }, type:{ type:Number, default:0 } }, data() { return { show:false, value:'' } }, mounted(){ if(this.def){ this.value = this.def.text } }, methods: { clickSelectInput(){ this.show = true }, clickSelectOption(item){ this.value = item.text this.$emit('option',item); this.show = false }, hideSelectOption(){ this.show = false } }, watch:{ def:function (n,o) { this.value = n.text } } })