<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                [TOC] ## 1. 子組件是模板文件 向父組件傳參 ### 1. 先在子組件的wxml中綁定一個點擊事件 bind:tap="onLike" ~~~ <view class="container"> <image src="{{isLike?yesSrc:noSrc}}" class="icon" bind:tap="onLike"></image> <text>{{count}}</text> </view> ~~~ ### 2. 在子組件的js的methods的方法中處理事件 使用triggerEvent方法向父組件傳參 ~~~ methods: { onLike(){ var isLike = this.properties.isLike; var count = this.properties.count; if(isLike){ this.setData({ isLike:false, count:count-1 }) }else{ this.setData({ isLike:true, count:count+1 }) } let behavior = this.properties.isLike?"like":"like/cancel"; /* 在子組件中自定義事件,向組父組件傳遞參數 */ this.triggerEvent("wang",{behavior:behavior}); } } ~~~ ### 3. 在父組件的wxml中綁定一個方法名為 triggerEvent定義的方法名 的事件 ~~~ <v-like isLike="{{classic.like_status}}" count="{{classic.fav_nums}}" bind:wang="onLike"></v-like> ~~~ ### 4. 然后再js中處理事件得到參數 ~~~ Page({ onLoad(){ wx.request({ url: 'http://bl.7yue.pro/v1/classic/latest', header: { 'Content-Type': 'application/json', "appkey":"9xK0CrzQREI1yGPh" }, success: res=>{ this.setData({ classic:res.data }) } }) }, onLike(e){ console.log(e.detail) } }) ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看