需求 后臺給的導(dǎo)航 數(shù)據(jù)是這樣的{NAME:導(dǎo)航,nid:5456456456456456}點擊對應(yīng)的導(dǎo)航 刷新對應(yīng)的內(nèi)容 ,內(nèi)容是通過導(dǎo)航的ID 來獲取對應(yīng)的內(nèi)容的我導(dǎo)航頁面是這么寫的 <div class="nav"> <ul class="clearfix">
<li v-for="(item,index) in navData" :key="index" >
<router-link :to="{path:'/navlist',query:{ id:item.nid }}">{{ item.NAME }}</router-link>
</li>
</ul>
</div>這是詳情頁面代碼created() { this.get_nav_id()
}, computed:{
}, methods: {
get_nav_id() { var listDetails = this.$route.query.id; JSON.stringify(listDetails) var data ={ nid:listDetails
} this.$post(this.$commion.listUrl,data)
.then(response => { console.log(response);
})
.catch(function(error) { console.log(error);
});
}
}可是我點機的時候 數(shù)據(jù)打印不出來 我這么寫不對么
添加回答
舉報
0/150
提交
取消