我得到了Json数据并用它做了一个带有vue.js的辅助导航栏,但我不能完成它,这是我的简单代码,
`
<nav class="nav" id="nav">
<ul class="navsBox">
<!-- The primary navigation -->
<template v-for="item in navItems" v-on="mouseover: mouseOver">
<li><a href="#">{{item.gc_name}}</a></li>
</template>
</ul>
</nav>
`
var vm = new Vue({
el :'#nav',
data: {
navItems: ''
},
created: function() {
var _self = this;
$.ajax({
type :'GET',
url: 'http://1390.iluckycat.com/api/parent/class',
success: function(data) {
_self.navItems = data.data;
}
})
},
methods: {
mouseOver: function(){
}
}
})