Comments (3)
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);
vue-quill-editor base64 to imgUrl
from vue-quill-editor.
看到简书文章了,是dmeo 代码中实例名称定义错误,应该是quill
,而非quillEditor
from vue-quill-editor.
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.
from vue-quill-editor.
Related Issues (20)
- img标签中带有height高度时 无法进行拖拽设置大小
- 如何给图片设置超链接
- 发现删除和回车都会触发text-change事件,唯独输入文字时不会触发,这是为啥,你们没有遇到吗? HOT 3
- Toolbar styles are sometimes not loaded
- Copy a multi-level nested list, paste it into the editor, and the list level becomes confused
- A vue page that loops through multiple quill components cannot get the quill instance of the current operation
- Uncaught DOMException: Failed to execute 'setStart' on 'Range': The offset 4294967295 is invalid.
- 选中toolbar中 加粗 或 斜体后再次点击无法取消 HOT 1
- Uncaught TypeError: Cannot read properties of undefined (reading 'register') HOT 1
- Unable to get the content from @change event when the grammerly is active on editor.
- 加入组件后出错
- Editor Converts inline styles to quill classes but these classes not working out of my web app
- With Grammar and Spelling checker by Ginger 2.0.189 Chrome extension, this.quill.on('text-change'...) emits the wrong dom.
- How to apply Chinese interface ah
- vue-quill-editor
- ref quill is undefined
- Upgrade to Quill 2.0 HOT 2
- dangerouslyPasteHTML插入元素后输入出现问题
- 提一个小问题
- when my content have e.x <div> so content not supported it.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-quill-editor.