wangEditor icon indicating copy to clipboard operation
wangEditor copied to clipboard

selectMenu无法添加svg,DropPanelMenu无法在没有jquery情况下传递点击事件出去

Open Liuone opened this issue 2 years ago • 4 comments

问题描述

vue2 用wangEditor5的时候,自定义新菜单,想类似于下拉选择。目前有两种方案都进行尝试,1.selectMenu, 2. DropPanelMenu, 目前selectMenu看issue无法添加svg图片(不知道有什么其他方法), DropPanelMenu无法添加点击事件(官网中getPanelContentElem用的jquery语法$,而vue2中直接添加click事件无效,添加onclick可以输出内容,但是无法传递出去,并且这样无法关闭DropPanelMenu),我想通过点击下拉菜单唤起弹框啊或者什么的。

wangEditor 版本

"@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^1.0.2",

是否查阅了文档 ?

最小成本的复现步骤

getPanelContentElem(editor) { const $list = (<ul> <li onclick="console.log('北京')">北京</li> <li>上海</li> <li>深圳</li> </ul>)

return $list

} Snipaste_2023-08-11_18-32-11

Liuone avatar Aug 11 '23 10:08 Liuone

我尝试了selectMenu,就是无法改图标,如果我后期通过css改变图标样式,再次触发编辑器焦点还是会改回小箭头

Liuone avatar Aug 23 '23 10:08 Liuone

暂时用文字替代了: 用selectMenu渲染 image 通过 styleForRenderMenuList: {display: 'none'}} 隐藏标题 效果如下: image

Liuone avatar Sep 15 '23 02:09 Liuone

兄弟有解决方案吗?@Liuone

wangchaodeyuzhou avatar Jun 07 '24 04:06 wangchaodeyuzhou

getValue方法中要固定return options中隐藏的那个选项,这个案例中固定return ‘title'.

yorang1 avatar Oct 11 '24 10:10 yorang1