diff --git a/package.json b/package.json index db4627b..b55142b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "multiple-select", "main": "dist/multiple-select.min.js", "module": "dist/multiple-select-es.min.js", - "version": "2.0.6", + "version": "2.0.8", "type": "module", "title": "Multiple Select", "description": "Multiple select is a jQuery plugin to select multiple elements with checkboxes :).", diff --git a/src/MultipleSelect.js b/src/MultipleSelect.js index 3fd9f5b..e16143e 100644 --- a/src/MultipleSelect.js +++ b/src/MultipleSelect.js @@ -159,7 +159,7 @@ class MultipleSelect { value: it } } - return it + return { ...it } }) } else if (typeof this.options.data === 'object') { for (const [value, text] of Object.entries(this.options.data)) { diff --git a/src/vue/MultipleSelect.vue b/src/vue/MultipleSelect.vue index cf77678..98f5986 100644 --- a/src/vue/MultipleSelect.vue +++ b/src/vue/MultipleSelect.vue @@ -230,7 +230,7 @@ export default { single: !this.multiple, width: this.width, size: this.size, - data: deepCopy(this.data) + data: this.data } if (!this._hasInit) { diff --git a/vue-examples/package.json b/vue-examples/package.json index 6bbbdfa..e866254 100644 --- a/vue-examples/package.json +++ b/vue-examples/package.json @@ -8,18 +8,18 @@ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore" }, "dependencies": { - "highlight.js": "^11.8.0", - "jquery": "^3.7.0", - "multiple-select": "^1.7.0", - "vue": "^3.4.15", - "vue-router": "^4.0.0" + "highlight.js": "^11.9.0", + "jquery": "^3.7.1", + "multiple-select": "^2.0.7", + "vue": "^3.4.31", + "vue-router": "^4.4.0" }, "devDependencies": { - "@vitejs/plugin-vue": "^5.0.4", - "autoprefixer": "^10.4.18", + "@vitejs/plugin-vue": "^5.0.5", + "autoprefixer": "^10.4.19", "eslint": "^8.49.0", - "eslint-plugin-vue": "^9.17.0", - "vite": "^5.1.5" + "eslint-plugin-vue": "^9.27.0", + "vite": "^5.3.3" }, "eslintConfig": { "root": true, diff --git a/vue-examples/src/examples/Data.vue b/vue-examples/src/examples/Data.vue index c12218e..f6f1cb7 100644 --- a/vue-examples/src/examples/Data.vue +++ b/vue-examples/src/examples/Data.vue @@ -7,6 +7,7 @@
@@ -59,6 +60,7 @@
@@ -71,6 +73,7 @@ export default { data () { return { + basic: [], basicData: [ { text: 'January', @@ -141,6 +144,7 @@ export default { numberData: [ 1, 2, 3 ], + groups: [1], groupData: [ { type: 'optgroup', @@ -148,8 +152,7 @@ export default { children: [ { text: 'January', - value: 1, - selected: true + value: 1 }, { text: 'February', diff --git a/vue-examples/src/plugins/select.js b/vue-examples/src/plugins/select.js index d24e0a9..b834dfd 100644 --- a/vue-examples/src/plugins/select.js +++ b/vue-examples/src/plugins/select.js @@ -1,8 +1,9 @@ -import 'multiple-select/dist/multiple-select.min.css' +import 'multiple-select/src/multiple-select.scss' import './jquery' import $ from 'jquery' -import 'multiple-select/src/multiple-select' -import 'multiple-select/dist/multiple-select-locale-all' +import 'multiple-select/src/multiple-select.js' +import 'multiple-select/src/locale/multiple-select-en-US' +import 'multiple-select/src/locale/multiple-select-zh-CN' $.extend($.fn.multipleSelect.defaults, $.fn.multipleSelect.locales['en-US']) diff --git a/vue-examples/src/registry.js b/vue-examples/src/registry.js index dfc0df3..3ccf56e 100644 --- a/vue-examples/src/registry.js +++ b/vue-examples/src/registry.js @@ -3,6 +3,9 @@ const raws = import.meta.glob('./examples/*.vue', { as: 'raw' }) const components = [] for (const path in modules) { + if (!modules[path]) { + continue + } const name = (/examples\/(.*).vue/.exec(path))[1] components.push({ diff --git a/vue-examples/src/views/Main.vue b/vue-examples/src/views/Main.vue index 9626841..e6043b7 100644 --- a/vue-examples/src/views/Main.vue +++ b/vue-examples/src/views/Main.vue @@ -96,6 +96,14 @@ const updateAds = () => { }, 500) } +const updateHighlight = () => { + nextTick(() => { + document.querySelectorAll('pre code').forEach(el => { + hljs.highlightElement(el) + }) + }) +} + watch(props.current, () => { updateAds() }) @@ -108,14 +116,6 @@ onMounted(() => { hljs.registerLanguage('xml', xml) updateHighlight() }) - -const updateHighlight = () => { - nextTick(() => { - document.querySelectorAll('pre code').forEach(el => { - hljs.highlightElement(el) - }) - }) -}