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

How to not have tags in 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>

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

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

期望的行为不会像示例中那样显示标记。

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