
Vue动态生成的input怎么实现数据双向绑定
1个回答
展开全部
你可以用渲染的时候让 h 这种动态生成的方法来加上this.my_variables ; 下面是例子
或者使用$refs,给你的input一个id,然后获取到以后,用compute好的值给他赋值;
renderHeader: (h)=>{
return h('div',[
h('strong','序号'),
h('Icon',{
props:{
type: this.my_variables
},
style: {
marginLeft: '5px'
}
})
]);
},
我也是在学习,希望能有所帮助
或者使用$refs,给你的input一个id,然后获取到以后,用compute好的值给他赋值;
renderHeader: (h)=>{
return h('div',[
h('strong','序号'),
h('Icon',{
props:{
type: this.my_variables
},
style: {
marginLeft: '5px'
}
})
]);
},
我也是在学习,希望能有所帮助
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询