Gathering detailed insights and metrics for quill-image-extend-module
Gathering detailed insights and metrics for quill-image-extend-module
Gathering detailed insights and metrics for quill-image-extend-module
Gathering detailed insights and metrics for quill-image-extend-module
ngx-quill
Angular components for the easy use of the QuillJS richt text editor.
quill-image-uploader
A module for Quill rich text editor to allow images to be uploaded to a server instead of being base64 encoded
quill-image-drop-and-paste
A quill editor module for drop and paste image, with a callback hook before insert image into the editor
quill-image-compress
A Quill rich text editor Module which compresses images uploaded to the editor
npm install quill-image-extend-module
75.2
Supply Chain
99.5
Quality
75.3
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
706 Stars
26 Commits
128 Forks
11 Watching
2 Branches
1 Contributors
Updated on 03 Sept 2024
Minified
Minified + Gzipped
JavaScript (83.27%)
Vue (16.73%)
Cumulative downloads
Total Downloads
Last day
-0.5%
193
Compared to previous day
Last week
-1.6%
1,036
Compared to previous week
Last month
1.4%
4,181
Compared to previous month
Last year
-54.6%
45,581
Compared to previous year
No dependencies detected.
sorry everyone, 由于作者自身原因,没有精力和时间处理issues,该插件已经不做维护了,希望大家见谅。
vue-quill-editor的增强模块,
功能:
1npm install quill-image-extend-module --save-dev
1 import {quillEditor, Quill} from 'vue-quill-editor' 2 import {container, ImageExtend, QuillWatch} from 'quill-image-extend-module' 3 4 Quill.register('modules/ImageExtend', ImageExtend)
1<template> 2 <div class="quill-wrap"> 3 <quill-editor 4 v-model="content" 5 ref="myQuillEditor" 6 :options="editorOption" 7 > 8 </quill-editor> 9 </div> 10</template> 11<script> 12 import {quillEditor, Quill} from 'vue-quill-editor' 13 import {container, ImageExtend, QuillWatch} from 'quill-image-extend-module' 14 15 Quill.register('modules/ImageExtend', ImageExtend) 16 export default { 17 components: {quillEditor}, 18 data() { 19 return { 20 content: '', 21 // 富文本框参数设置 22 editorOption: { 23 modules: { 24 ImageExtend: { 25 loading: true, 26 name: 'img', 27 action: updateUrl, 28 response: (res) => { 29 return res.info 30 } 31 }, 32 toolbar: { 33 container: container, 34 handlers: { 35 'image': function () { 36 QuillWatch.emit(this.quill.id) 37 } 38 } 39 } 40 } 41 } 42 } 43 } 44 } 45</script> 46
1 editorOption: { 2 modules: { 3 ImageExtend: { // 如果不作设置,即{} 则依然开启复制粘贴功能且以base64插入 4 name: 'img', // 图片参数名 5 size: 3, // 可选参数 图片大小,单位为M,1M = 1024kb 6 action: updateUrl, // 服务器地址, 如果action为空,则采用base64插入图片 7 // response 为一个函数用来获取服务器返回的具体图片地址 8 // 例如服务器返回{code: 200; data:{ url: 'baidu.com'}} 9 // 则 return res.data.url 10 response: (res) => { 11 return res.info 12 }, 13 headers: (xhr) => { 14 // xhr.setRequestHeader('myHeader','myValue') 15 }, // 可选参数 设置请求头部 16 sizeError: () => {}, // 图片超过大小的回调 17 start: () => {}, // 可选参数 自定义开始上传触发事件 18 end: () => {}, // 可选参数 自定义上传结束触发的事件,无论成功或者失败 19 error: () => {}, // 可选参数 上传失败触发的事件 20 success: () => {}, // 可选参数 上传成功触发的事件 21 change: (xhr, formData) => { 22 // xhr.setRequestHeader('myHeader','myValue') 23 // formData.append('token', 'myToken') 24 } // 可选参数 每次选择图片触发,也可用来设置头部,但比headers多了一个参数,可设置formData 25 }, 26 toolbar: { // 如果不上传图片到服务器,此处不必配置 27 container: container, // container为工具栏,此次引入了全部工具栏,也可自行配置 28 handlers: { 29 'image': function () { // 劫持原来的图片点击按钮事件 30 QuillWatch.emit(this.quill.id) 31 } 32 } 33 } 34 } 35 }
由于不同的用户的服务器返回的数据格式不尽相同
因此 在配置中,你必须如下操作
1 // 你必须把返回的数据中所包含的图片地址 return 回去 2 respnse: (res) => { 3 return res.info // 这里切记要return回你的图片地址 4 }
比如你的服务器返回的成功数据为
1{ 2code: 200, 3starus: true, 4result: { 5 img: 'http://placehold.it/100x100' // 服务器返回的数据中的图片的地址 6 } 7}
那么你应该在参数中写为:
1 // 你必须把返回的数据中所包含的图片地址 return 回去 2 respnse: (res) => { 3 return res.result.img // 这里切记要return回你的图片地址 4 }
1<template> 2 <div class="quill-wrap"> 3 <quill-editor 4 v-model="content" 5 ref="myQuillEditor" 6 :options="editorOption" 7 > 8 </quill-editor> 9 </div> 10</template> 11<script> 12 import {quillEditor, Quill} from 'vue-quill-editor' 13 import {container, ImageExtend, QuillWatch} from 'quill-image-extend-module' 14 import ImageResize from 'quill-image-resize-module' 15 16 Quill.register('modules/ImageExtend', ImageExtend) 17 // use resize module 18 Quill.register('modules/ImageResize', ImageResize) 19 export default { 20 components: {quillEditor}, 21 data() { 22 return { 23 content: '', 24 // 富文本框参数设置 25 editorOption: { 26 modules: { 27 ImageResize: {}, 28 ImageExtend: { 29 name: 'img', 30 size: 2, // 单位为M, 1M = 1024KB 31 action: updateUrl, 32 headers: (xhr) => { 33 }, 34 response: (res) => { 35 return res.info 36 } 37 }, 38 toolbar: { 39 container: container, 40 handlers: { 41 'image': function () { 42 QuillWatch.emit(this.quill.id) 43 } 44 } 45 } 46 } 47 } 48 } 49 } 50 } 51</script> 52
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/20 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More