Preface
本文为微信小程序开发笔记,现学现卖,正在学习中。
如有发现问题或者发现有什么不足的地方,请大佬们多多指教!!!(开发自己的微信小程序中……)
-目录
-绑定点击事件
-input绑定触发事件(两种)和input取值
-
Bind the click event
<view> <view> { { text}}</view> <button bindtap="changeText">按钮</button> </view>
Page({ data: { text: "点击前" }, changeText: function () { this.setData({ text: '点击后' }) } })
-
Input binding trigger event (two types) and input value
Look at the development documentation first to find the effect you want.
Example bindinput event
Effect: trigger once the content of the input box changes once
<input bindinput='changeInput' type='text' placeholder='请输入……'></input>
changeInput(e){
console.log(e.detail)
}