简体   繁体   中英

How to not have tags in vue-multiselect?

I am using vue-multiselect and I copied the example vue-multiselect multiple select

<div>
  <label class="typo__label">Simple select / dropdown</label>
  <multiselect v-model="value" :options="options" :multiple="true" :close-on-select="false" :clear-on-select="false" :preserve-search="true" placeholder="Pick some" label="name" track-by="name" :preselect-first="true">
    <template slot="selection" slot-scope="{ values, search, isOpen }"><span class="multiselect__single" v-if="values.length &amp;&amp; !isOpen">{{ values.length }} options selected</span></template>
  </multiselect>
  <pre class="language-json"><code>{{ value  }}</code></pre>
</div>

In the example it can be seen that the tags are not present, this happens in all examples, by default the tagging its not present in any example.

在此处输入图像描述

But when using the code of the example the tagging does show,

  • i tried using :taggable="false" ,
  • i tried using <template #tag></template>
  • I also inspected, and it's not CSS hiding it the tags are still showing. 在此处输入图像描述 Here its the minimal code to reproduce the issue.

The Desired behaviour its to not show the tagging just like in the examples.

You should use <template slot="tag">{{ '' }}</template> to hide the tags.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM