Skip to content

Commit c417cde

Browse files
zerononeDamian Dulisz
authored andcommitted
Fix Closure Compiler Errors (shentao#479)
* Fix string property keys Closure compiler requires `'string'` keys to be written as computed keys. `['string']` * Changed stringy keys to computed keys
1 parent 9d6446e commit c417cde

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

lib/multiselectMixin.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
66

77
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
88

9+
var _watch;
10+
911
var _utils = require('./utils');
1012

1113
var _utils2 = _interopRequireDefault(_utils);
@@ -260,20 +262,16 @@ exports.default = {
260262
return this.multiple ? this.searchable ? '' : this.placeholder : this.internalValue[0] ? this.getOptionLabel(this.internalValue[0]) : this.searchable ? '' : this.placeholder;
261263
}
262264
},
263-
watch: {
264-
'internalValue': function internalValue(newVal, oldVal) {
265-
if (this.resetAfter && this.internalValue.length) {
266-
this.search = '';
267-
this.internalValue = [];
268-
}
269-
},
270-
'search': function search() {
271-
this.$emit('search-change', this.search, this.id);
272-
},
273-
'value': function value(_value) {
274-
this.internalValue = this.getInternalValue(_value);
265+
watch: (_watch = {}, _defineProperty(_watch, 'internalValue', function internalValue(newVal, oldVal) {
266+
if (this.resetAfter && this.internalValue.length) {
267+
this.search = '';
268+
this.internalValue = [];
275269
}
276-
},
270+
}), _defineProperty(_watch, 'search', function search() {
271+
this.$emit('search-change', this.search, this.id);
272+
}), _defineProperty(_watch, 'value', function value(_value) {
273+
this.internalValue = this.getInternalValue(_value);
274+
}), _watch),
277275
methods: {
278276
getValue: function getValue() {
279277
return this.multiple ? (0, _utils2.default)(this.internalValue) : this.internalValue.length === 0 ? null : (0, _utils2.default)(this.internalValue[0]);

src/multiselectMixin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,17 +335,17 @@ export default {
335335
}
336336
},
337337
watch: {
338-
'internalValue' (newVal, oldVal) {
338+
['internalValue'] (newVal, oldVal) {
339339
/* istanbul ignore else */
340340
if (this.resetAfter && this.internalValue.length) {
341341
this.search = ''
342342
this.internalValue = []
343343
}
344344
},
345-
'search' () {
345+
['search'] () {
346346
this.$emit('search-change', this.search, this.id)
347347
},
348-
'value' (value) {
348+
['value'] (value) {
349349
this.internalValue = this.getInternalValue(value)
350350
}
351351
},

0 commit comments

Comments
 (0)