var app = new Vue({
el: '#app',
data: {
name: '大雄',
attr: 'hello'
},
computed: {
computedAttr: function () {
return this.attr + ' world'
}
}
})
<div id="app">
<input v-model="computedAttr" type="text" name="" id="" />
</div>