请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

第一次进入城市选择页面选择城市回到首页正常,再次进入城市选择页面进入选择城市就报错

vue-router.esm.js?fe87:2065 Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: "/".
    at createRouterError (webpack-internal:///./node_modules/vue-router/dist/vue-router.esm.js:2065:15)
    at createNavigationDuplicatedError (webpack-internal:///./node_modules/vue-router/dist/vue-router.esm.js:2035:15)
    at HashHistory.confirmTransition (webpack-internal:///./node_modules/vue-router/dist/vue-router.esm.js:2328:18)
    at HashHistory.transitionTo (webpack-internal:///./node_modules/vue-router/dist/vue-router.esm.js:2260:8)
    at HashHistory.push (webpack-internal:///./node_modules/vue-router/dist/vue-router.esm.js:2710:10)
    at eval (webpack-internal:///./node_modules/vue-router/dist/vue-router.esm.js:3026:22)
    at new Promise (<anonymous>)
    at VueRouter.push (webpack-internal:///./node_modules/vue-router/dist/vue-router.esm.js:3025:12)
    at VueComponent.handleCityClick (webpack-internal:///./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/pages/city/components/List.vue:57:26)
    at click (webpack-internal:///./node_modules/vue-loader/lib/template-compiler/index.js?{"id":"data-v-9fb13f12","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/pages/city/components/List.vue:71:36)

正在回答 回答被采纳积分+3

1回答

Dell 2021-07-18 21:26:58

报错那块的截图发来看下,感觉是循环重定向了

0 回复 有任何疑惑可以回复我~
  • 提问者 慕码人4339946 #1
    methods:{
            handleCityClick(city){
                this.changeCity(city);
                this.$router.push('/');
            },
    
            ...mapMutations(['changeCity']),
    
        },
      
    updated(){
            this.scroll = new Bscroll(this.$refs.wrapper,{click:true});
        },
    就是加了{click:true}
    第一次选择城市回到了首页没问题,然后在进去选择城市回到首页就报错了
    回复 有任何疑惑可以回复我~ 2021-07-19 12:09:59
  • Dell 回复 提问者 慕码人4339946 #2
    不加没问题吗
    回复 有任何疑惑可以回复我~ 2021-07-19 23:15:54
  • 回复 Dell不加的,真机测试城市选择点击无效
    回复 有任何疑惑可以回复我~ 2021-09-08 17:16:01
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信