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

insertEmbed link invalid #466

Open
TigerXZhang opened this issue Dec 10, 2021 · 1 comment
Open

insertEmbed link invalid #466

TigerXZhang opened this issue Dec 10, 2021 · 1 comment

Comments

@TigerXZhang
Copy link

TigerXZhang commented Dec 10, 2021

handleFileSuccess (res, file) {
let fileNameLength = file.name.length
let quill = this.$refs.myQuillEditor.quill
let length = quill.getSelection().index;
quill.insertText(length, ''+file.name+'', "silent")
quill.insertEmbed(length, 'link', {href:res, innerText:file.name}, "api")
quill.setSelection(length + fileNameLength)
}

handleImgSuccess(res){
let quill = this.$refs.myQuillEditor.quill
if (res) {
let length = quill.getSelection().index;
quill.insertEmbed(length, 'image', res)
quill.setSelection(length + 1)
} else {
this.$message.error('图片插入失败')
}
}

quill.insertEmbed(length, 'image', res) Take effect
quill.insertEmbed(length, 'link', {href:res, innerText:file.name}, "api") invalid

Why?

@wanWanWei
Copy link

you need to add lint blot

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