Comments (3)
addHandler
is not a valid quill api.
from vue-quill-editor.
https://quilljs.com/docs/modules/toolbar/ excuse me but can you read the last line of code on the page you/your team wrote.
from vue-quill-editor.
addHandler
is valid quill api (now) ,
You can both overwrite the handler in beblow ways:
1. Overwrite Directly
toolbar.handlers.image = function () {
// do something here
}
2. AddHandler
toolbar.addHandler('image', function(){
// do something here
})
Note :
this
in handler function point to Toolbar object, if you want to use it, keep in mind don't write in arrow function way
And the function handler define here is src code :
[[FunctionLocation]]: quill.js?9339:6851
image: function image() {
var _this3 = this;
var fileInput = this.container.querySelector('input.ql-image[type=file]');
if (fileInput == null) {
fileInput = document.createElement('input');
fileInput.setAttribute('type', 'file');
fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon');
fileInput.classList.add('ql-image');
fileInput.addEventListener('change', function () {
if (fileInput.files != null && fileInput.files[0] != null) {
var reader = new FileReader();
reader.onload = function (e) {
var range = _this3.quill.getSelection(true);
_this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER);
_this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT);
fileInput.value = "";
};
reader.readAsDataURL(fileInput.files[0]);
}
});
this.container.appendChild(fileInput);
}
fileInput.click();
},
from vue-quill-editor.
Related Issues (20)
- How does the mobile terminal determine the @ symbol in Chinese mode
- 编辑器的超链接放入h5://开头的链接无效,点击save后,a标签href为about:blank(The link starting with h5:// in the editor is invalid. After you click Save, the href of the a label is about:blank.)
- strong,em,u,h2那些标签无法回显在文本框里 HOT 1
- 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
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.