微信小程序学习之triggerEvent
更新:HHH   时间:2023-1-7


    1.tag/index.wxml

    <view bind:tap="onTap"></view>

    2.tag/index.js

    properties:{
        text:String
    },
    methods:{
        onTap:function(event){
            this.triggerEvent("tapping",{
                text:this.propertie.text
            },{})
        }
    }

    3.在父组件页面上要引入子组件

        1.detail.wxml

      <tap-cmp bind:tapping="onPost"></tap-cmp>

        2.detail.js

      onPost:function(event){
          event.detail.text
      }


返回web开发教程...