chore: move has multiple calculation to computed
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
kolaente 2021-11-09 19:49:30 +01:00
parent b76250196a
commit 70f78758a2
Signed by: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -9,7 +9,7 @@
<div class="control" :class="{'is-loading': loading || localLoading}">
<div
class="input-wrapper input"
:class="{'has-multiple': multiple && Array.isArray(internalValue) && internalValue.length > 0}">
:class="{'has-multiple': hasMultiple}">
<template v-if="Array.isArray(internalValue)">
<template v-for="(item, key) in internalValue">
<slot name="tag" :item="item">
@ -232,6 +232,9 @@ export default {
return this.searchResults
},
hasMultiple() {
return this.multiple && Array.isArray(this.internalValue) && this.internalValue.length > 0
},
},
methods: {
// Searching will be triggered with a 200ms delay to avoid searching on every keyup event.