有时候,需要使用单向数据流绑定store的state的业务场景,我们可以结合computed属性使用,绕开data属性
<el-input v-model="userAccountID" clearable placeholder="请输入用户ID"></el-input>
computed:{
userAccountID: {
get(){
return this.orderChannelParam.userAccountID
},
set(value){
this.mergeModel({name:'orderChannelParam',value:{userAccountID:value}})
}
},
}
网友评论