Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

将图片拖拽入编辑器,根据图片data-data,对图片进行特殊的处理 #5869

Open
ZWKJ-DH opened this issue May 23, 2024 · 3 comments

Comments

@ZWKJ-DH
Copy link

ZWKJ-DH commented May 23, 2024

问题描述

将图片拖拽入编辑器,根据图片data-data,对图片进行特殊的处理

wangEditor 版本

5 vue2

是否查阅了文档 ?

(文档链接 www.wangeditor.com

最小成本的复现步骤

(请告诉我们,如何最快的复现该问题?)

  • 步骤一
  • 按照快速开始搭建wangeditor页面
  • 步骤二
  • 在页面中editor外面创建图片标签:如<img src="xxx.png" :data-data="data">
  • 步骤三
  • 将图片拖拽入editor中,这时,图片所有属性都没了,处理不了图片
    微信截图_20240523154310
@cycleccc
Copy link

想要额外的处理需要做插件扩展,wangEditor5基于 slate ,会对富文本进行格式化,data-data不是img的属性,会过滤掉的。

@ZWKJ-DH
Copy link
Author

ZWKJ-DH commented May 23, 2024

能提供一下具体的思路嘛?我想不出

@cycleccc
Copy link

cycleccc commented May 25, 2024

@ZWKJ-DH 参考 https://www.wangeditor.com/v5/plugins.html 有教程及 demo,你的需求是 不过滤 data-data 属性,应该不难实现。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants