子应用使用wangeditor无法对已存在的数据进行修改
子应用使用wangeditor无法对已存在的数据进行修改
初始化子应用富文本框的值,点击图标聚焦到wangeditor后,无法删除
请给一个简单的 demo,省的我复现环境哈
请给一个简单的 demo,省的我复现环境哈
选中不可添加样式,应该也是选取的问题,劳烦看看~
由于是vite,jsLoader 插件无法工作,在子应用中添加了一个 compatible-wujie.js 文件:
const fs = require('node:fs');
const path = require('node:path');
const wangEditorPath = path.resolve('../', 'sub-arco-design/node_modules/@wangeditor/editor/dist/index.esm.js');
let wangEditor = fs.readFileSync(wangEditorPath, 'utf-8');
wangEditor = wangEditor.replace(
`e instanceof t.Selection`,
`e instanceof t.top.Selection`
);
fs.writeFileSync(wangEditorPath, wangEditor);
然后再 package.json的 scripts 中添加:
"postinstall": "node ./compatible-wujie.js",
重新 npm i 一下,代码就替换了,可以解决无法删除的问题,还是有很多其他的问题,哎,具体问题出现在 getSelectedNodeAndMenuKeys 函数里面,太难找了
添加了一个 compatible-wujie.js 文件 虽然是可以更改了,但是无法粘贴内容,哎真是一个头两个大
由于是vite,jsLoader 插件无法工作,在子应用中添加了一个 compatible-wujie.js 文件:
const fs = require('node:fs'); const path = require('node:path'); const wangEditorPath = path.resolve('../', 'sub-arco-design/node_modules/@wangeditor/editor/dist/index.esm.js'); let wangEditor = fs.readFileSync(wangEditorPath, 'utf-8'); wangEditor = wangEditor.replace( `e instanceof t.Selection`, `e instanceof t.top.Selection` ); fs.writeFileSync(wangEditorPath, wangEditor);然后再 package.json的 scripts 中添加:
"postinstall": "node ./compatible-wujie.js",重新 npm i 一下,代码就替换了,可以解决无法删除的问题,还是有很多其他的问题,哎,具体问题出现在 getSelectedNodeAndMenuKeys 函数里面,太难找了
不止是vite,webpack也有同样问题,现在可以输入了 但是无法复制粘贴。