通过对象动态生成input,在chrome下鼠标总是指向末尾的字符,textarea不会出现此问题
大家有遇到过这种情况吗?
var MyComponent = Vue.extend({
props:['form'],
template: '' +
'' +
'{{ form.help }}
',
})
Vue.component('my-component', MyComponent)
// 创建根实例
new Vue({
el: '#example',
data:{
detail:{
"vname": {
"title": "vname",
"name": "vname",
"value": "",
"help": "",
"inputType": "text"
},
"vcode": {
"title": "vcode",
"name": "vcode",
"value": "",
"help": "",
"inputType": "text"
},
}
}
})
演示地址
http://runjs.cn/code/twbnkmux
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
把
':value="form.value" ' +去了...双向绑定不要和value一起用...道理自己琢磨下就知道了...