compiled: function(){
.....
var self = this;
console.log('teste');
$.ajax({
url: 'js/fake-ws.json',
complete: function (data) {
self.$data.musics = data
console.log(self.$data.musics);
}
})
}
<div id="playlist" class="panel panel-default">
<div class="panel-body">
<ul>
<li
v-repeat="musics.item"
>
<a href="">{{nome}}</a>
</li>
<ul>
</div>
</div>
转载请注明:谷谷点程序 » vue.js获取json的方法