简体   繁体   English

如何在 vue-multiselect 中没有标签?

[英]How to not have tags in vue-multiselect?

I am using vue-multiselect and I copied the example vue-multiselect multiple select我正在使用 vue-multiselect 并复制了示例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" ,我尝试使用:taggable="false"
  • i tried using <template #tag></template>我尝试使用<template #tag></template>
  • I also inspected, and it's not CSS hiding it the tags are still showing.我还检查了,它不是 CSS 隐藏它标签仍在显示。 在此处输入图像描述 Here its the minimal code to reproduce the issue. 是重现该问题的最少代码。

The Desired behaviour its to not show the tagging just like in the examples. Desired 行为不像示例中那样显示标记。

You should use <template slot="tag">{{ '' }}</template> to hide the tags.您应该使用<template slot="tag">{{ '' }}</template>来隐藏标签。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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