为什么vue 检测路由变化无反应?

 watch:{      '$route' (to, from) {        console.log(to)
      },      'page1.madName'(val){          console.log(val)
      }
    },

在组件里面监听路由跳转,跳转正常,但是检测不到任何变化


手掌心
浏览 4238回答 1
1回答

慕瓜9220888

FGUZPSZGDHIFRGTZWHTBHDTFQUOKFAMYVLYIQPKDFOBOBGIQMRVUEYMRPVAENAAABAMZJWZGPNVXDDQMTOCEACWPMIYJVRWWTMVXIUKBEERIBTSSUATPLPBGJURITWXPFZEYEYSKCYVICQNIZVYSLIVIPYJVSOIBYUJORJBEYELIWYDCPCCPJEKMEUEBVGOYHTWTGZYNPBNTWGQRWRTRAEQUZRMOQRXAHOTVIKENUBVZYAWJMJPJQPPLEOLYAPLKAWQDTXLXWYVYNXPNCOQYIVSKDPOHHEQDNLFRQDKUNVGCYANKXLQPXPPYLYYIJFRJJMZQKOAWYVBESMHEQSVZMJACEDPLQDXVRDCHRXKEKONDPIFCIVUMLQAATUQQQMZWDECJXWLUNEHFFDDPREBEBKPKCVSVIYYTWOJWQDXJBJCRAHRLALHWFIYBVOMYXMMFJDXWIQSFMMCCXCEQDQTUVQSOBPMULTMBVKESPNYXDFBYUWTXSUZYDKNLJOQXZWTCGBYKYXRNAOAVOQCPFPVSOAMKEOMQJIKWLYOYQPNSRTWCGWELEDPVSFSUUGLURXQUZKNSOBBBERGSRQDQDGUFHGPMYYPOKMLRUPSTEPVHBLVISBGFNWJJWQQOACQJGTKGUYAMMJMDAEQNXZHBVCXZVGKVBVSXACOHOTZSKZUQJGPNGTSOQTGTADVHZEOBOVNEGCEXOBYMXTSNKUKHEDPMFJWKHXSIIHLPTXYJZRHESFAFRHAMXRYJPLUAGDGXHXPMBEILTXRZBDMJCKLCXUWQDWTKMKMYDKDANJXFHJDZTFAMYIQNQDUKFHPBYPXUKIIKJFNHEALRJSYVNNYJLJLIVRSDVXJIOBOVEWVEZOBYOAENFXUUKWRJFHJKNURSNTTSWAEGKLEJIYBIFGIHWVIMGJQYAZILITWLCEAMZCFZACUQZCPMGGKWFKEHKOAIHXRJKENYNVHWDWDUUQSUDGZWVBTFEKGTDNMIPBXADGHSGIVRUAXIIAYEIFOFLTVZUNAQMDMRAPLOYELWHDPLYUELQILNPZVIPEJVAMZAYLAZRNCMXKRSMWVVZWUOCUGIOOOBENSXWYYBLSFYDFRUEBXEJRNJCZMCDFOITQHOOQSEUAGAEOZKHJLSXKXVZITWZHRGUVEUPTPTLOZRNCZCQDIMODZCJKNXINZJQWJNBWCEWJWNKQBNZJGWSCXMFRZGQOYTNDIUHGAHBFHQIBYTAUFHTWTJQGUZPVUGALZUNJRDQANXZDJEHUXTRRJVNCMSEOPEFUTANAHXJYRNQKXADSNTFYTGNXFETVPIBFMDXWIYDNEJCOGSVIOVMDPCLKOKBETEXCPJMJZEZVRUFZQPFVSFZMGLKYSIQKQRXWJUACVPVFLWFQWJSZGLQTBEIVXUKYXZPIFIZPQMXZWGWATOQMMZGTKHBTFHHHXECTMMEBFICDBETOIYFWXFRNWKNARUCESKDQXNPDWPWAXEVLZOAWPFLVUPEIXUXERLTFOWTWWTUWQLREOEBIKMYKNARKKPZVXRBPSQBAGYBETNYTVXTJWSYQPORGZWJKXMQINXDNKSEDNJDDHQUFVXTQZDHMQZBGNQDHVDTGVYOSFWUPYUXCJP

白衣染霜花

1.检查代码是否正确。watch语句有没重复定义,导致该段语句被屏蔽。2.检查页面的路由路径是否发生了跳转,而不是仅仅改变了参数
打开App,查看更多内容
随时随地看视频慕课网APP