富文本wangeditor层级太高覆盖element ui 时间选择器组件问题

10,273 阅读1分钟
  • 时间选择器被富文本的选项被富文本编辑器挡住了 (wangeditor层级z-index很高 会覆盖掉和他重合的区域)

1.png

.w-e-menu {
 width: 28px!important;//修改顶部菜单每个选项的宽度
}
//在css里加上如下样式即可(使用vue的话不能放在scoped里 不然会没有效果) :把编辑器的z-index调低
.w-e-text-container {
 z-index: 1 !important;
}
.w-e-toolbar {
  z-index: 1 !important;
}

使用后的效果如下

edit.png

  • 或者可以在编辑器里直接配置 配置 z-index 编辑器 z-index 默认为 10000,可以自行调整。 注意:z-index值需要>=0
const editor = new E('#div1')

editor.config.zIndex = 500

editor.create()