Skip to content

Cannot read property 'propsData' of undefined at VueComponent.renderCommonMenuItem #577

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

Closed
1 task
xyyVee opened this issue Mar 13, 2019 · 11 comments
Closed
1 task
Labels

Comments

@xyyVee
Copy link

xyyVee commented Mar 13, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.3.5

Environment

Windows x64, Chrome 70, vue-cli 3.5.0

Reproduction link

Edit on CodeSandbox

Steps to reproduce

follow the step: https://vue.ant.design/components/menu-cn/#API

What is expected?

It should be the same as the image example of the official website.

What is actually happening?

throw an error:

vue.runtime.esm.js?2b0e:1887 TypeError: Cannot read property 'propsData' of undefined
    at VueComponent.renderCommonMenuItem (SubPopupMenu.js?1462:277)
    at VueComponent.renderMenuItem (SubPopupMenu.js?1462:338)
    at eval (SubPopupMenu.js?1462:390)
    at Array.map (<anonymous>)
    at Proxy.render (SubPopupMenu.js?1462:389)
    at VueComponent.Vue._render (vue.runtime.esm.js?2b0e:3535)
    at VueComponent.updateComponent (vue.runtime.esm.js?2b0e:4041)
    at Watcher.get (vue.runtime.esm.js?2b0e:4444)
    at Watcher.run (vue.runtime.esm.js?2b0e:4519)
    at flushSchedulerQueue (vue.runtime.esm.js?2b0e:4275)
@ghost
Copy link

ghost commented Mar 14, 2019

Hi there!

You should import custom sub-menu component (see docs)
Screenshot: https://i.gyazo.com/bc8d07bb333546164dff9ca8a779e858.png

@xyyVee
Copy link
Author

xyyVee commented Mar 14, 2019

But i have already input antd globally,Is there still have the necessity to input again?

@tangjinzhou
Copy link
Member

@xiayuying <a-sub-menu /> not <sub-menu/>

@mgnrfk
Copy link

mgnrfk commented Sep 9, 2019

Hi,

I have a similar issue, I used the fully imported Antd but I want to switch to importing components one by one, if I import "Menu", I have the same "Cannot read property 'propsData' of undefined when I replace <a-menu ..> with <Menu ..>

@yf-hk
Copy link

yf-hk commented Aug 6, 2020

@mgnrfk Have you found any solution?

@sjaslow
Copy link

sjaslow commented Aug 26, 2020

This appears to be a design problem in SubPopupMenu::render() around line 393, where the code makes an assumption that child nodes are antd menu items. That prevents using other components within such as OP's example, or portals/slots for dynamic menus, and so on. For example, you will get the error doing code below if the slot contains anything other than antd items (such as wrappers):

<a-menu> <slot name="menu-items"></slot> </a-menu>

@Leocat81
Copy link

但是我已经antd在全球范围内输入了,是否仍然需要再次输入?
不需要了

@grafikri
Copy link

When I wanted to use ant-design-vue dropdown menu plugin, I was getting such kind of error. My components registrations was like this;

components: {
  'a-menu': Menu,
  'a-menu-item': Menu.Item,
  'a-dropdown': Dropdown,
}

Then I removed the 'a-menu-item' line, the error disappeared

components: {
  'a-menu': Menu,
  'a-dropdown': Dropdown,
}

maybe it could be help

@kevinxuv
Copy link

kevinxuv commented Sep 2, 2021

same issue

@kevinxuv
Copy link

kevinxuv commented Sep 2, 2021

@xiayuying <a-sub-menu /> not <sub-menu/>

加了还是有问题

@github-actions
Copy link

github-actions bot commented Sep 3, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants