Closed NavOrange closed 3 years ago
我也是这个问题,之前反馈过了,很奇怪的是examples运行不会报这个错,对比了很多地方,至今都没解决,希望up关注一下这个问题!
本人测试过没有问题,尝试清空 node_modules 后重装依赖再试试?
如果你遇到此类问题。请考虑提供一个可复现的代码仓库 否则光凭这么一段内容 无法查到是为什么
这是 prolayout 的 template,如果不会搭配环境可以直接考虑使用本 template 代码; https://github.com/sendya/preview-pro
感谢回复 补上仓库 https://github.com/Shuhua95/preview-pro
这是 prolayout 的 template,如果不会搭配环境可以直接考虑使用本 template 代码; https://github.com/sendya/preview-pro up,您好,我将代码fork了一份出来,然后加上了菜单自定义渲染,您看下这个问题! 仓库地址:https://github.com/jianshen-weo/antdv-layouts
跟 provide, inject 有关,暂时无解
手动包装的 menu-item 没有包装在 menu 下,所以无法享用 menu 的 provide inject
手动包装的 menu-item 没有包装在 menu 下,所以无法享用 menu 的 provide inject
感谢耐心回复啦!有什么替代方案可是实现自定义菜单吗?
@jianshen-weo @Shuhua95 升级到 3.1.0-beta.6
应该可以解决
为什么改下了 menu 的导入就可以工作了 🤔
重现步骤:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'prefixCls') at setup47 (MenuItem.js:49) at callWithErrorHandling (runtime-core.esm-bundler.js:6992) at setupStatefulComponent (runtime-core.esm-bundler.js:6608) at setupComponent (runtime-core.esm-bundler.js:6564) at mountComponent (runtime-core.esm-bundler.js:4423) at processComponent (runtime-core.esm-bundler.js:4398) at patch (runtime-core.esm-bundler.js:3993) at mountChildren (runtime-core.esm-bundler.js:4189) at processFragment (runtime-core.esm-bundler.js:4357) at patch (runtime-core.esm-bundler.js:3986)
像是 pro-layout 使用 menuItemRender 导致的