uncaught (in promise) typeerror: cannot read properties of undefined (reading 'matched') at tagsbar.vue:8:14 | vue.js | vue.js 技术论坛-大发黄金版app下载

接手了一个项目,用到了vue。遇见报错:typeerror: cannot read properties of undefined (reading ‘matched’) 问题。
描述:切换选项卡的时候,系统报错,如下图:

根据错误定位,找到代码:

用console打印后,发现除了第一次请求正常返回一些数据。其他点击事件返回的都是undefined。不太懂vue的运行逻辑,求会解的大佬,答一下~

最佳答案

你改成这样

import { computed } from 'vue';
import { useroute } from 'vue-router';
const route = useroute();
const goroute = computed(() => {
  //todo:
})

还有就是你的选项卡的数据来源是有误的。
建议你重构,通过store根据用户权限去生成相应的选项卡数据

2个月前
(楼主) 2个月前
(作者) 2个月前
(楼主) 2个月前
讨论数量: 4

你改成这样

import { computed } from 'vue';
import { useroute } from 'vue-router';
const route = useroute();
const goroute = computed(() => {
  //todo:
})

还有就是你的选项卡的数据来源是有误的。
建议你重构,通过store根据用户权限去生成相应的选项卡数据

2个月前
(楼主) 2个月前
(作者) 2个月前
(楼主) 2个月前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!
网站地图