Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

两个报错 uncaught at _callee3 at _callee3 Warning: SubMenu should not leave undefined "key" #1129

Open
loading-99 opened this issue Apr 2, 2022 · 3 comments

Comments

@loading-99
Copy link

git仓库下来后,出现两个报错 uncaught at _callee3 at _callee3 Warning: SubMenu should not leave undefined "key".
两个error均已解决,
第一个解决方法,将src/plugins/onError.js复制到src中,并修改文件名为app.js,报错原因为dvamodel错误未处理,我想知道正确的方法应该如何解决,如何将plugins/onError.js直接引入而非新增app.js
第二个解决方法,为src/components/layout/Header.js中的两个<SubMenu />组件加上key属性。

@LDD123
Copy link

LDD123 commented Apr 2, 2022 via email

@wblucky
Copy link

wblucky commented Oct 27, 2022

src/app.js 添加下面的代码

import { message } from 'antd'

export const dva = {
    config: {
      onError(e) {
        e.preventDefault();
        if (e.message) {
            message.error(e.message)
          } else {
            /* eslint-disable */
            console.error(e)
          }
      },
    },
  };

@LDD123
Copy link

LDD123 commented Oct 27, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants