bind:tap与bindtap两者是等价的
-
bind:tap是完整写法,结构清晰,但较少使用 -
bindtap是简写形式,更推荐使用
html
<view bindtap="handleTap">点击</view>
html
<!-- 等价于 -->
<view bind:tap="handleTap">点击</view>
js
Page({
handleTap() {
console.log("触发点击事件");
}
});