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

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

Open
GoldenMao opened this issue Mar 31, 2022 · 4 comments
Open

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

GoldenMao opened this issue Mar 31, 2022 · 4 comments

Comments

@GoldenMao
Copy link

首先感谢作者提供这么好的组件!
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
Copy link

建议本地调试时将
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
Copy link

zzy-life commented Apr 6, 2023

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

@zzy-life
Copy link

zzy-life commented Apr 6, 2023

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

@LiuZhiLin-Innocellence
Copy link

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

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

4 participants