微信小程序报 For developer:Two-way binding does not support complex data paths currently. This two-way binding is ignored.

微信小程序报:For developer:Two-way binding does not support complex data paths currently. This two-way binding is ignored.

翻译过来是:对于开发人员:双向绑定目前不支持复杂的数据路径。这种双向绑定被忽略。

原因:model:value 不是能双向绑定 子对象 的值,如定义了

   data: {
    MainJobCommission:{  
            ShopJobName:''}
    }
}

在页面双向绑定,就会不生效。

 <van-field
                required
                is-link 
                size="large"
                model:value="{{MainJobCommission.ShopJobName}}" />

 

解决办法:

添加bind:input 或 bind:change方法,当输入值时修改对象的值

 onServiceMinuteChange(event){
        this.setData({
            ['MainJobCommission.ShopJobName'] : event.detail
        })
        //console.log("ServiceMinute",this.data.MainJobCommission.ServiceMinute)
    },

 

posted @ 2024-08-27 10:39  ziff123  阅读(134)  评论(0编辑  收藏  举报