新版input绑定bindinput,调用setdata,无法输入中文
如题,开发者工具,真机都不行,可以的你们告诉我下怎么做才能实时获取到input值,并在模板中使用??
< form bindsubmit = "formSubmit" > < input type = "text" id = "ipt_key" value="{{param.keyword}}
name = "keyword" bindinput = "keyInput" /> < button form-type = "submit" class = "btn" >搜索</ button > </ form > |
keyInput: function (e) { var key = e.detail.value; // 这里不管更新哪个,都会导致无法输入中文 this .setData({ 'param.keyword' : key, 'inputKeyword' : key }); this .matchHistory(key); } |
使用姿势不对??