阅读量:131
vue中实现数据绑定的方式有:1.使用Mustache语法单向绑定数据;2.通过v-bind指令绑定html属性;3.通过v-once指令一次性绑定数据;

vue中实现数据绑定的方式有以下几种
1.使用Mustache语法实现数据单向绑定
{{text}}
[removed]
var app = new Vue({
el: '#app',
data: {
text: 'text content'
}
});
[removed]
2.通过v-bind指令绑定html属性
[removed]
var app = new Vue({
el: '#app',
data: {
title: 'title content'
}
});
[removed]
3.通过v-once指令实现数据一次性绑定
{{once}}
[removed]
var app = new Vue({
el: '#app',
data: {
once: 'once content'
}
});
app.once = 'changed content';
[removed]