Chrome 105.0.5195.54
Element 2.13.0
仍存在此bug 笔记本稳定触发
借用楼上 @RandyZ 的代码 直接放在一个cascaderFix.vue
文件里了 应该可以直接cv去用了
@/components/cascaderFix.vue
<script>
import { Cascader } from "element-ui";
function cascaderVisable(e, item) {
const $el = document.querySelectorAll(
".el-cascader-panel .el-cascader-node[aria-owns]"
);
Array.from($el).map((item) => item.removeAttribute("aria-owns"));
if (item && item.visible !== undefined && item.visibleChange) {
item.visibleChange(e);
}
}
export default {
extends: Cascader,
name: "CascaderFix",
mounted() {
this.$on("visible-change", cascaderVisable);
},
};
</script>
<style lang="less">
.el-scrollbar {
overflow: hidden;
position: relative;
}
</style>
用法
import CascaderFix from "@/components/cascaderFix.vue";
//省略
components: {
CascaderFix,
}