vue 简略版select自定义组件

// 组件格式
Vue.component("select-template",{
      template:'
' + '' + '
    ' + '
  • {{item}}
  • ' + '
', props:['school','value','disabled'], data: function () { return { inputfocus: false, schoolName: '' } }, methods:{ toggleMenu: function (e) { e.stopPropagation(); if (this.disabled) { return } this.inputfocus = !this.inputfocus; }, choseItem (item) { this.schoolName = item; this.$emit('input', item); } }, created: function () { } }); // 调用组件

 

你可能感兴趣的:(vue,前端)