Component

作者: 泉落云生 | 来源:发表于2018-09-20 17:04 被阅读6次
  1. 创建一个新插件

  2. 在page.json中使用"usingComponents":{"ele":"path"}

  3. 在页面中直接使用 <ele></ele> 标签

  4. 通过设置list(props)="{{data}}"​父级向插件传值

  5. 插件使用properties:{list:{type:String/Object,value:''/{},host:null}} 先进行定义 才能使用父级 传入的值

6.插件修改上一级的值
page 绑定事件
bind:myevent="InfoChange"
infoChange(e){
console.log(e.detail)
}
component
bindgetuserinfo="bindGetUserInfo"
methods:{
bindGetUserInfo(e){
this.triggerEvent('myevent', myEventDetail)
}
}

相关文章

网友评论

      本文标题:Component

      本文链接:https://www.haomeiwen.com/subject/miunnftx.html