From 4cd44b209c353da61fb67e8fece9e0334d8c6eb2 Mon Sep 17 00:00:00 2001 From: Damian Dulisz Date: Wed, 8 Mar 2017 22:44:09 +0100 Subject: [PATCH] Bump version to beta-15 --- lib/multiselectMixin.js | 7 +++++-- package.json | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/multiselectMixin.js b/lib/multiselectMixin.js index 4b483526..8e02414b 100644 --- a/lib/multiselectMixin.js +++ b/lib/multiselectMixin.js @@ -257,12 +257,15 @@ exports.default = { this.$emit('search-change', this.search, this.id); }, 'value': function value(_value) { - this.internalValue = (0, _utils2.default)(Array.isArray(_value) ? _value : [_value]); + this.internalValue = this.getInternalValue(_value); } }, methods: { getValue: function getValue() { - return this.multiple ? (0, _utils2.default)(this.internalValue) : (0, _utils2.default)(this.internalValue[0]); + return this.multiple ? (0, _utils2.default)(this.internalValue) : this.internalValue.length === 0 ? null : (0, _utils2.default)(this.internalValue[0]); + }, + getInternalValue: function getInternalValue(value) { + return value === null || value === undefined ? [] : this.multiple ? (0, _utils2.default)(value) : (0, _utils2.default)([value]); }, filterAndFlat: function filterAndFlat(options) { return flow(filterGroups(this.search, this.label, this.groupValues, this.groupLabel), flattenOptions(this.groupValues, this.groupLabel))(options); diff --git a/package.json b/package.json index d3dbbb08..f17046f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-multiselect", - "version": "2.0.0-beta.14", + "version": "2.0.0-beta.15", "description": "Multiselect component for vue.js", "author": "Damian Dulisz ", "private": false, @@ -25,7 +25,7 @@ "unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --watch", "test": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run", "lint": "eslint --ext .js,.vue src test/unit/specs", - "finish": "npm run lint && npm test && npm run build" + "finish": "npm run lint && npm test && npm run bundle" }, "devDependencies": { "autoprefixer": "^6.7.2",