Closed beibeijerry closed 7 years ago
Try to search for your issue, it may have already been answered or even fixed in the development branch.
It is required that you clearly describe the steps necessary to reproduce the issue you are running into. Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from the issue author for more than 5 days, it will be closed.
It is recommended that you make a JSFiddle/JSBin/Codepen to demonstrate your issue. You could start with this template that already includes the latest version of Vue.
For potential SSR (Server Side Rendering) issue or bugs that involves build setups, you can create a reproduction repository with steps in the README.
If your issue is resolved but still open, don’t hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it.
i used the customButtonClick to upload pictures(change the base64 to img url ) . i can get the img url but can not insert the img url in content.
customButtonClick(){
var range = this.$refs.myTextEditor.quillEditor.getSelection()
var length = range.index;
var imageUrl = 'http://xxxxx/content/images/thumbs/0004868.jpeg'
this.quillEditor.insertEmbed(length, 'image', imageUrl);
},
getSelection()
insertEmbed() all undefined
is customButton can not get the content focus
I have solved this problem by using a Clumsy method:
onEditorFocus(editor) {
// console.log('editor focus!', editor)
this.editor = editor
},
onEditorReady(editor) {
// console.log('editor ready!', editor)
this.editor = editor
},
customButtonClick(){
var range
if (this.editor.getSelection() != null) {
range = this.editor.getSelection()
this.length = range.index
} else {
this.length = this.content.length
}
this.$el.querySelector('.custom-input').click();
},
...
other code same as [#21](https://github.com/surmon-china/vue-quill-editor/issues/21)@SkyFire-Lee to upload img (base64 to url) get the imgUrl
...
finally insert the imgUrl
this.editor.insertEmbed(this.length, 'image', this.imgUrl);
看到简书文章了,是dmeo 代码中实例名称定义错误,应该是quill
,而非quillEditor
中文用户请注意:
BUG REPORT TEMPLATE
编写,禁止在标题中堆砌!Got a question?
The issue list of this repo is exclusively for bug reports and feature requests. For simple questions, please use the following resources:
Read the docs: https://vuejs.org/guide/
Look for/ask questions on stack overflow: https://stackoverflow.com/questions/ask?tags=vue.js
Reporting a bug?
Try to search for your issue, it may have already been answered or even fixed in the development branch.
It is required that you clearly describe the steps necessary to reproduce the issue you are running into. Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from the issue author for more than 5 days, it will be closed.
It is recommended that you make a JSFiddle/JSBin/Codepen to demonstrate your issue. You could start with this template that already includes the latest version of Vue.
For potential SSR (Server Side Rendering) issue or bugs that involves build setups, you can create a reproduction repository with steps in the README.
If your issue is resolved but still open, don’t hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it.
Have a feature request?
BUG REPORT TEMPLATE
Vue.js version and component version
Reproduction Link
Steps to reproduce
What is Expected?
What is actually happening?