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

我正在使用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>

在示例中可以看到标签不存在,在所有示例中都会发生这种情况,默认情况下,在任何示例中标签都不存在。

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

但是当使用示例代码时,标记确实显示了

  • 我尝试使用:taggable="false"
  • 我尝试使用<template #tag></template>
  • 我也检查过了,不是CSS隐藏它 标签仍在显示。

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

    Here是重现问题的最少代码。

所需行为不会像示例中那样显示标记。

iCMS 回答:如何在vue-multiselect中没有标签?

您应该使用<template slot="tag">{{ '' }}</template>隐藏标签。

本文链接:https://www.f2er.com/1926634.html

大家都在问