在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/HTML/ vue-route路由跳轉(zhuǎn)同一個(gè)子頁(yè)面時(shí)數(shù)據(jù)不會(huì)更新 要刷新一次頁(yè)面才會(huì)更新數(shù)

vue-route路由跳轉(zhuǎn)同一個(gè)子頁(yè)面時(shí)數(shù)據(jù)不會(huì)更新 要刷新一次頁(yè)面才會(huì)更新數(shù)據(jù),用watch的話怎么監(jiān)聽(tīng)?

就是在一個(gè)子頁(yè)面中請(qǐng)求的動(dòng)態(tài)數(shù)據(jù)能夠跳轉(zhuǎn)不同的分類(lèi)是進(jìn)行數(shù)據(jù)更新
動(dòng)態(tài)數(shù)據(jù)請(qǐng)求
created () {

  // location.reload() 
  var num1=sessionStorage.getItem('number')
  this.num=num1
  // console.log(this.num)
  let url_shoplit=this.HOST+"/czy/index.php?gct=api&gp=getClassifyPage&cid="+this.num+'&curpage='
  console.log(url_shoplit);
  $axios.get(url_shoplit)
  .then(res=>{
    this.getshoplist(res.data)
  })
},
route.js

import Vue from 'vue'
import Router from 'vue-router'
import home from '@/components/home'
import Shoplist from '@/components/shoplist'
import Shopshow from '@/components/shopshow'
Vue.use(Router)

export default new Router({
routes: [

{
  path: '/home',
  name: 'home',
  component:resolve => require(['@/components/home'], resolve),
},
{
  path:'/shoplist',
  name:'shoplist',
  component:Shoplist
},
{
  path:'/shopshow',
  name:'shopshow',
  component:Shopshow
},
{
  path:'/',
  redirect:'/home'
}

]
})

clipboard.png
不管怎么跳轉(zhuǎn) cid的值都不會(huì)變 要刷新才會(huì)改變

回答
編輯回答
忘了我

watchthis.$route

2018年3月19日 11:53
編輯回答
咕嚕嚕

監(jiān)聽(tīng)this.num然后再去請(qǐng)求

2017年10月13日 21:11