亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長(zhǎng)資訊網(wǎng)
    最全最豐富的資訊網(wǎng)站

    微信小程序怎樣點(diǎn)擊傳值

    微信小程序怎樣點(diǎn)擊傳值

    微信小程序怎樣點(diǎn)擊傳值

    微信小程序點(diǎn)擊傳值的方法:

    1、首先在wxml中使用data-來(lái)添加自定義屬性;

    2、然后通過(guò)bindtap來(lái)綁定點(diǎn)擊事件;

    3、最后在js中用currentTarget來(lái)獲取傳遞的值即可。

    推薦學(xué)習(xí):小程序開(kāi)發(fā)

    代碼示例:

    wxml:

    data-參數(shù)名="值"

    bindtap="函數(shù)名"

    <view class="buy-button {{cap_select == 100 ? 'zp-active': ''}}" data-cap="100" bindtap="choose_cap">   <text>100ML n (2兩)</text> </view>

    JS:

    choose_cap(e) {   // 通過(guò) currentTarget 獲取傳遞進(jìn)來(lái)的值   console.log(e.currentTarget.dataset.cap);   console.log(e); },

    PHP中文網(wǎng),大量網(wǎng)站建設(shè)教程,歡迎學(xué)習(xí)!

    贊(1)
    分享到: 更多 (0)
    網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)