Skip to content

Commit e64731b

Browse files
author
surmon
committed
fix object assign
1 parent edc269b commit e64731b

File tree

6 files changed

+37
-6
lines changed

6 files changed

+37
-6
lines changed

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ module.exports = {
742742
"prefer-reflect": 0,
743743

744744
// 在ES2015(ES6)中推荐使用剩余参数(...rest)代替arguments变量
745-
"prefer-rest-params": 2,
745+
"prefer-rest-params": 0,
746746

747747
// 在ES2015(ES6)中推荐使用扩展符替代apply()方法
748748
"prefer-spread": 2,

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
### V3.0.3
55

6+
1. fix object assign in spa
7+
8+
### V3.0.3
9+
610
1. fix import es module bug
711
2. add test script
812

dist/vue-quill-editor.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-quill-editor",
33
"description": "Quill editor component for Vue",
4-
"version": "3.0.3",
4+
"version": "3.0.4",
55
"license": "MIT",
66
"private": false,
77
"author": {

src/editor.vue

+29-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,37 @@
66
</template>
77

88
<script>
9+
// require sources
910
import _Quill from 'quill'
10-
import objectAssign from 'object-assign'
1111
import defaultOptions from './options'
1212
const Quill = window.Quill || _Quill
13+
14+
// pollfill
15+
if (typeof Object.assign != 'function') {
16+
Object.defineProperty(Object, 'assign', {
17+
value(target, varArgs) {
18+
if (target == null) {
19+
throw new TypeError('Cannot convert undefined or null to object')
20+
}
21+
const to = Object(target)
22+
for (let index = 1; index < arguments.length; index++) {
23+
const nextSource = arguments[index]
24+
if (nextSource != null) {
25+
for (const nextKey in nextSource) {
26+
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
27+
to[nextKey] = nextSource[nextKey]
28+
}
29+
}
30+
}
31+
}
32+
return to
33+
},
34+
writable: true,
35+
configurable: true
36+
})
37+
}
38+
39+
// export
1340
export default {
1441
name: 'quill-editor',
1542
data() {
@@ -47,7 +74,7 @@
4774
if (this.$el) {
4875
4976
// Options
50-
this._options = objectAssign({}, this.defaultOptions, this.globalOptions, this.options)
77+
this._options = Object.assign({}, this.defaultOptions, this.globalOptions, this.options)
5178
5279
// Instance
5380
this.quill = new Quill(this.$refs.editor, this._options)

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import _Quill from 'quill'
99
import quillEditor from './editor.vue'
1010

1111
const Quill = window.Quill || _Quill
12-
const install = function (Vue, globalOptions) {
12+
const install = (Vue, globalOptions) => {
1313
if (globalOptions) {
1414
quillEditor.props.globalOptions.default = () => globalOptions
1515
}

0 commit comments

Comments
 (0)