Vue.component('set-menu',{
template:'<ul><li v-for="item in ht" v-bind:data-id="item.id"><div @click="_click"><i class="s-font" v-bind:class="item.iconClass"></i>{{item.name}}</div><ul v-if="item.oth"><li v-for="items in item.oth"><i class="s-font" v-bind:class="items.iconClass"></i>{{items.name}}</li></ul></li></ul>',
data:function(){
var datas;
$.ajax({
type:"get",
url:"data.json",
async:false,
cache:false,
success:function(data){
datas=data.sites;
}
});
console.log(datas)
return {ht:datas}
},
methods:{
_click:function(){
this.$emit('click',function(){
alert(123)
})
}
}
})
慕尼黑8549860
相关分类