Skip to content

Commit

Permalink
🐛 fix custom toolbar option
Browse files Browse the repository at this point in the history
  • Loading branch information
Li committed Mar 8, 2021
1 parent eca70f9 commit c72936f
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 26 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ node_modules
.env.local
.env.*.local

# Package
package-lock.json
yarn.lock

# Log files
npm-debug.log*
yarn-debug.log*
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Lili
Copyright (c) 2021 flyween

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# vue3-quill
Quill editor for vue3
Quill editor for vue3

<p lign="left">
<a href="https://npmcharts.com/compare/vue3-quill?minimal=true"><img src="https://img.shields.io/npm/dm/vue3-quill.svg?sanitize=true" alt="Downloads"></a>
<a href="https://www.npmjs.com/package/vue3-quill"><img src="https://img.shields.io/npm/l/vue3-quill.svg?sanitize=true" alt="License"></a>
</>


## Usage

```javascript
Expand Down Expand Up @@ -51,7 +58,11 @@ export default {
editorOption: {
placeholder: 'core',
modules: {
}
toolbars: {
// custom toolbars options
// will override the default configuration
}
},
},
disabled: false
})
Expand Down Expand Up @@ -80,11 +91,13 @@ export default {
</script>
```


# Packages
Forked from: [vue-quill-editor](https://github.com/surmon-china/vue-quill-editor) Inspired by this one

[Quill ImageHandler Module](https://www.npmjs.com/package/quill-image-uploader)

# Welcome PR
Thanks to the open source.
For the convenience of all friends, please contribute your code :heart:
Thanks to the open source. :heart:

[![HitCount](http://hits.dwyl.com/flyween/vue3-quill.svg)](http://hits.dwyl.com/flyween/vue3-quill)
20 changes: 18 additions & 2 deletions example/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<script>
import { reactive } from 'vue'
import { Quill } from 'vue3-quill'
import { Quill } from '../src/index.js'
console.log(Quill)
import ImageUploader from "quill-image-uploader"
Expand All @@ -34,7 +34,23 @@ export default {
}, 3500);
});
},
}
},
toolbar: [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block'],
[{ header: 1 }, { header: 2 }],
[{ list: 'ordered' }, { list: 'bullet' }],
[{ script: 'sub' }, { script: 'super' }],
[{ indent: '-1' }, { indent: '+1' }],
[{ direction: 'rtl' }],
[{ size: ['small', false, 'large', 'huge'] }],
[{ header: [1, 2, 3, 4, 5, 6, false] }],
[{ color: [] }, { background: [] }],
[{ font: [] }],
[{ align: [] }],
['clean'],
['link', 'image', 'video']
]
}
},
disabled: true
Expand Down
2 changes: 1 addition & 1 deletion example/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createApp } from 'vue'
import App from './App.vue'

import { quillEditor } from 'vue3-quill'
import { quillEditor } from '../src'

const app = createApp(App)

Expand Down
15 changes: 15 additions & 0 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "example",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"quill-image-uploader": "^1.2.2"
}
}
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue3-quill",
"version": "0.2.2",
"version": "0.2.3",
"private": false,
"main": "src/index.js",
"keywords": [
Expand All @@ -16,6 +16,10 @@
"lint": "vue-cli-service lint",
"lib": "vue-cli-service build --target lib --name vue3-quill --dest lib src/index.js"
},
"files": [
"lib",
"src"
],
"dependencies": {
"core-js": "^3.6.5",
"quill": "^1.3.7",
Expand All @@ -30,6 +34,14 @@
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0-0"
},
"repository": {
"type": "git",
"url": "https://github.com/flyween/vue3-quill.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/flyween/vue3-quill/issues"
},
"eslintConfig": {
"root": true,
"env": {
Expand Down
6 changes: 2 additions & 4 deletions src/editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,10 @@ export default {
const mergeOptions = (def, custom) => {
for (const key in custom) {
if (!def[key]) {
if (!def[key] || key !== 'modules') {
def[key] = custom[key]
} else {
if (key === 'modules') {
mergeOptions(def[key], custom[key])
}
mergeOptions(def[key], custom[key])
}
}
return def
Expand Down
14 changes: 1 addition & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5910,10 +5910,6 @@ quill-delta@^3.6.2:
extend "^3.0.2"
fast-diff "1.1.2"

quill-image-uploader@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/quill-image-uploader/-/quill-image-uploader-1.2.2.tgz#ef4722f0394fbbcdef937d9ad29b4b43e2f5c3f3"

quill@^1.3.7:
version "1.3.7"
resolved "https://registry.npm.taobao.org/quill/download/quill-1.3.7.tgz#da5b2f3a2c470e932340cdbf3668c9f21f9286e8"
Expand Down Expand Up @@ -7213,15 +7209,7 @@ vue-template-es2015-compiler@^1.9.0:
version "1.9.1"
resolved "https://registry.npm.taobao.org/vue-template-es2015-compiler/download/vue-template-es2015-compiler-1.9.1.tgz#1ee3bc9a16ecbf5118be334bb15f9c46f82f5825"

vue3-quill@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/vue3-quill/-/vue3-quill-0.2.0.tgz#e2168b7a798d3206c61fac0cbf043bd80ee8c6e7"
dependencies:
core-js "^3.6.5"
quill "^1.3.7"
vue "^3.0.0"

vue@^3.0.0, vue@^3.0.4:
vue@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.0.4.tgz#872c65c143f5717bd5387c61613d9f55f4cc0f43"
dependencies:
Expand Down

0 comments on commit c72936f

Please sign in to comment.