vue-antd-admin icon indicating copy to clipboard operation
vue-antd-admin copied to clipboard

混合模式下切换标签Cannot read property 'meta' of undefined

Open Uqhs opened this issue 4 years ago • 1 comments

当导航模式设置为混合模式的时候,切换菜单会出现 Cannot read property 'meta' of undefined的错误; 找到报错的地方,调试发现错误在menu.js的250行 if(chose.meta && chose.meta.highlight) 因为chose不存在时发生,于是自己加上了判断 if (chose && chose.meta && chose.meta.highlight) ,问题得到解决,不知道此解决方法是否彻底解决问题,有待研究

vue.runtime.esm.js?2b0e:1888 TypeError: Cannot read property 'meta' of undefined
    at VueComponent.getSelectedKeys (menu.js?301a:250)
    at VueComponent.updateMenu (menu.js?301a:239)
    at VueComponent.$route (menu.js?301a:137)
    at Watcher.run (vue.runtime.esm.js?2b0e:4568)
    at flushSchedulerQueue (vue.runtime.esm.js?2b0e:4310)
    at Array.eval (vue.runtime.esm.js?2b0e:1980)
    at flushCallbacks (vue.runtime.esm.js?2b0e:1906)

Uqhs avatar Jun 02 '21 02:06 Uqhs

我也遇到了这个问题,根据你的方法,加上了判断 if (chose && chose.meta && chose.meta.highlight),混合布局下不会报错了,非常感谢

Johnwjl avatar Sep 13 '21 09:09 Johnwjl