Skip to content

SubMenu默认插槽vue3版本下不生效 #2839

@lid1987

Description

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

Version

2.0.0-beta.5

Environment

vue3.0.0

Reproduction link

Edit on CodeSandbox

sandbox导入vue3的项目提示错误,也可以使用下面的项目看复现项目
https://github.com/lid1987/vue3-ant.git

Steps to reproduce

renderSubMenu: function (h, menu, pIndex, index) {
const this2_ = this
const subItem = []
const itemArr = []
const pIndex_ = pIndex   '_'   index
if (!menu.hideChildrenInMenu) {
menu.children.forEach(function (item, i) {
itemArr.push(this2_.renderItem(h, item, pIndex_, i))
})
}
const slots = {
default:()=>itemArr,
title:()=>h('span', [menu.meta.title])
}
console.log('------',itemArr)
return h(SubMenu, { key: menu.path ? menu.path : 'submenu_'   pIndex   '_'   index},slots)
},

itemArr输出显示已经有值,但是页面渲染不出来,
试了这个方法直接返回itemArr,也可以渲染出来,不清楚是写法有问题,还是SubMenu的默认slots有问题?帮忙看看吧,多谢

What is expected?

可以正常显示子菜单

What is actually happening?

子菜单不显示

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions