haochuan9421 / vue-ueditor-wrap

🚴Vue + 🚄UEditor + v-model双向绑定🚀
https://hc199421.gitee.io/vue-ueditor-wrap/
MIT License
1.6k stars 449 forks source link

秀米编辑文章后点击导出无法将内容返回给uedior #170

Open GoldenMao opened 2 years ago

GoldenMao commented 2 years ago

首先感谢作者提供这么好的组件! https://hc199421.gitee.io/vue-ueditor-wrap/#/xiumi, 我按照第二种方式集成秀米,但是编辑文章后点击导出无法将内容返回给uedior window.addEventListener( 'message', function (event) { console.log('Received message from xiumi, origin: %o %o', event.origin, xiumi_url); if (event.origin == xiumi_url) { console.log('Inserting html'); editor.execCommand('insertHtml', event.data); editor.fireEvent('catchRemoteImage'); // 注意:这里要触发一下抓取远程图片的事件,才能把秀米图片转存到自己的存储服务上 console.log('Xiumi dialog is closing', event.data); dialog.close(); } }, false ); 控制台并未打印 console.log('Received message from xiumi, origin: %o %o', event.origin, xiumi_url);监听没有执行,希望作者能帮我解惑

Hitzujinno commented 2 years ago

建议本地调试时将 xiumi.contentWindow.postMessage('XIUMI:3rdEditor:Connect', xiumi_url); 改为 xiumi.contentWindow.postMessage('XIUMI:3rdEditor:Connect', '*'); 然后你就会发现控制台打印Received message from xiumi, origin: 'https://xiumi.us' 'http://xiumi.us'

这是由于postMessage里的targetOrigin并不完全匹配导致的 https://developer.mozilla.org/zh-CN/docs/Web/API/Window/postMessage

zzy-life commented 1 year ago

我也有这个问题,秀米编辑的文本都回显出来了,但是值没有双向绑定

zzy-life commented 1 year ago

只能通过这种方式 this.formData.introduce = this.editorInstance.getContent();赋值

LiuZhiLin-Innocellence commented 9 months ago

抓取图片时候返回的数据为什么是undefined: [url]