关于路由跳转的问题
来源:15-5 Vue-router(下)

wykun
2017-06-22
问题是这样的.
我的router-link代码
<router-link :to="{path:'/gamedetial/'+ game.id}">
<img :src="game.img" alt="">
<div class="game-box clearfix">
<p class="game-name" :data-game="game.id">
<span class="game-the-name">{{ game.name }}</span>
<span v-if="game.ishot == 1" class="is-hot">热门</span>
<span v-if="game.isnew == 1" class="is-new">最新</span>
<span v-if="game.gift !== null" class="is-gift">礼包</span>
</p>
<p class="game-content">{{ game.content }}</p>
</div>
</router-link>
我的显示代码
created(){
this.$http.get('http://h5.wan855.cn/api/h5/game/gameinfo/gid/'+this.$route.params.gid).then(function (res) {
this.game = res.body
console.log(this.$route.params.gid)
console.log(this.game.articletype)
}
老师,现在我惦记 gid=6 的时候跳的路由地址是6,gid=7的时候跳转的gid=7,但是他页面的数据还是6的.有什么办法才能每次跳转路由的时候我都能把我created()中的数据刷新了呢?
2回答
-
wykun
提问者
2017-06-23
这个是在微信客户端上的页面,h5.wan855.cn我想点热门游戏里的游戏图标跳转到游戏详情,但是再点别的游戏它的游戏详情是你第一次点过的游戏详情。。012017-06-23 -
ustbhuangyi
2017-06-23
这个似乎不像是课程的代码喔,提供一下可访问的 demo 页面?
012017-06-23
相似问题