inputEdit: function (e) { let that = this; let field = e.currentTarget.dataset.field; let value = e.detail.value; that.setData({ [`formData.${field}`]: e.detail.value, }); console.log(“inputEdit“) console.log(that.data.formData) },
blurEdit: function (e) { let that = this; let field = e.currentTarget.dataset.field; let value = e.detail.value; if (that.data.formData[`${field}`] != e.detail.value) { that.setData({ [`formData.${field}`]: that.data.formData[`${field}`] || e.detail.value, }); } console.log(“blurEdit“) console.log(that.data.formData) },
所以怎么解决呢!
楼主,你解决了吗?能分享一下解决方案么
一直没有解决。在以前用Powerbuilder用数据窗口时sybase开发系统有一个 AcceptText()来解决,小程序这个真的是大Bug。中文输入法时通常是这个:Do not have inputEdit handler in current page.
你好,请参考
input无法获取值的问题
https://developers.weixin.qq.com/blogdetail?action=get_post_info&docid=00004890704008db9e07d80165d800&highline=%E6%89%8B%E5%86%99%E8%BE%93%E5%85%A5
你这参考好像是也没有解决问题吧
let that = this;
let field = e.currentTarget.dataset.field;
let value = e.detail.value;
that.setData({
[`formData.${field}`]: e.detail.value,
});
console.log(“inputEdit“)
console.log(that.data.formData)
},
blurEdit: function (e) {
let that = this;
let field = e.currentTarget.dataset.field;
let value = e.detail.value;
if (that.data.formData[`${field}`] != e.detail.value) {
that.setData({
[`formData.${field}`]: that.data.formData[`${field}`] || e.detail.value,
});
}
console.log(“blurEdit“)
console.log(that.data.formData)
},
通常我这样解决 inputEdit(e) + blurEdit(e) 。