m0_65213775 2022-04-22 14:25 采纳率: 90.5%
浏览 3596
已结题

Error in v-on handler: "TypeError: Cannot read properties of undefined (reading 'push')"

export default {
name: "TabBarItem",
props: {
path:String
},
methods: {
itemClick(){
return this.$router.push(this.path)
// this.$router.replace(this.path).catch(err => err)
// if (this.$route.path !== this.path) {this.$router.replace(this.path)} 防止多次点击报错
}
}
};

点击事件,一直提示push'无效,请问是哪里有问题

  • 写回答

2条回答 默认 最新

  • 雾里桃花 2022-04-22 14:38
    关注

    检查一下main.js里面的配置对不对

    img

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 4月30日
  • 已采纳回答 4月22日
  • 创建了问题 4月22日