小程序 数据绑定

 

 

小程序实现数据双向绑定需要借助属性 bindinput绑定方法名

#wxml 
<view class="content"> <textarea focus="true" auto-focus="true" maxlength="100" placeholder="请输入打卡内容" value="{{contents}}" bindinput="areainput"></textarea> </view>

 

#js
areainput(res){
this.setData({ contents:res.detail.value }) },
posted @ 2020-12-22 19:34  TestingShare  阅读(62)  评论(0编辑  收藏  举报