Bug Type: Component
Environment
- Vue Version:
3.2.45
- Element Plus Version:
2.2.28
- Browser / OS:
Edg/108.0.1462.76/ Windows 11 22H2
- Build Tool:
Vite
Reproduction
Related Component
el-menu-item-group
Reproduction Link
Element Plus Playground
Steps to reproduce
<script setup>
const isCollapse = ref(true)
const handleOpen = (key, keyPath) => {
console.log(key, keyPath)
}
const handleClose = (key, keyPath) => {
console.log(key, keyPath)
console.log("Close");
}
</script>
<template>
<el-radio-group v-model="isCollapse" style="margin-bottom: 20px">
<el-radio-button :label="false">展开</el-radio-button>
<el-radio-button :label="true">关闭</el-radio-button>
</el-radio-group>
<el-menu default-active="1" class="el-menu-vertical-demo" :collapse="isCollapse" @open="handleOpen"
@close="handleClose">
</el-menu>
</template>
使用这样的代码(官网上的例子也是一样),点击关闭按钮正常关闭el-menu但没有触发@close事件
What is Expected?
点击关闭触发el-menu的@close事件
What is actually happening?
没有触发@close事件
Additional comments
(empty)
2条答案
按热度按时间8i9zcol21#
我认为准确来说collapse的切换应该是不该触发open。
@element-plus/backers WDYT?
erhoui1w2#
对就是这个意思