view
<div id='demo' class="container"> <input type="text" v-model='name'> <pre> {{ $data | json }}</pre> </div>
js
new Vue({ el: '#demo', data: { name: 'foobar' } });
显示
添加函数
new Vue({ el: '#demo', data: { name: 'foobar' }, ready:function(){ var that = this; setInterval(function(){ that.name = 'Updated'; }, 5000); } });