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
npm install quill-image-extend-module
Typescript
Module System
Node Version
NPM Version
JavaScript (83.27%)
Vue (16.73%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
706 Stars
26 Commits
127 Forks
10 Watchers
2 Branches
1 Contributors
Updated on May 08, 2025
Latest Version
1.1.2
Package Id
quill-image-extend-module@1.1.2
Size
10.55 kB
NPM Version
5.5.1
Node Version
8.9.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
No dependencies detected.
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: { 4 loading: true, // 可选参数 是否显示上传进度和提示语 5 name: 'img', // 图片参数名 6 size: 3, // 可选参数 图片大小,单位为M,1M = 1024kb 7 action: updateUrl, // 服务器地址, 如果action为空,则采用base64插入图片 8 // response 为一个函数用来获取服务器返回的具体图片地址 9 // 例如服务器返回{code: 200; data:{ url: 'baidu.com'}} 10 // 则 return res.data.url 11 response: (res) => { 12 return res.info 13 }, 14 headers: (xhr) => {}, // 可选参数 设置请求头部 15 sizeError: () => {}, // 图片超过大小的回调 16 start: () => {}, // 可选参数 自定义开始上传触发事件 17 end: () => {}, // 可选参数 自定义上传结束触发的事件,无论成功或者失败 18 error: () => {}, // 可选参数 上传失败触发的事件 19 success: () => {}, // 可选参数 上传成功触发的事件 20 change: (xhr, formData) => {} // 可选参数 选择图片触发,也可用来设置头部,但比headers多了一个参数,可设置formData 21 }, 22 toolbar: { 23 container: container, // container为工具栏,此次引入了全部工具栏,也可自行配置 24 handlers: { 25 'image': function () { // 劫持原来的图片点击按钮事件 26 QuillWatch.emit(this.quill.id) 27 } 28 } 29 } 30 } 31 }
由于不同的用户的服务器返回的数据格式不尽相同
因此 在配置中,你必须如下操作
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 loading: true, 30 name: 'img', 31 size: 2, // 单位为M, 1M = 1024KB 32 action: updateUrl, 33 headers: (xhr) => { 34 }, 35 response: (res) => { 36 return res.info 37 } 38 }, 39 toolbar: { 40 container: container, 41 handlers: { 42 'image': function () { 43 QuillWatch.emit(this.quill.id) 44 } 45 } 46 } 47 } 48 } 49 } 50 } 51 } 52</script> 53
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/20 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
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 2025-07-14
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