HTML
<div id="category-two" class="mui-control-content">
<section v-for="brands in brand_list">
<header class="category-title">{{brands.type_name}}</header>
<ul>
<li class="category-item" v-for="brandItem in brands">
{{brandItem.name}}
</li>
</ul>
</section>
</div>
JS
mui.init();
(function($) {
var brandList = new Vue({
el: '#category-two',
data: {
brand_list:{}
},
ready: function() {
var self = this;
$.getJSON(GETBRAND_URL,function(list){
self.brand_list = list.data.brand_list;
}
);
}
});
})(mui);
模拟的brand_list对象数据是可以显示的,但是使用ajax获取数据这一步就出问题了
我想你的ready应该是生命周期钩子吧,ready现在已经被mounted取代了。