簡體   English   中英

如何在 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>

在示例中可以看到標簽不存在,這在所有示例中都會發生,默認情況下,標記在任何示例中都不存在。

在此處輸入圖像描述

但是當使用示例代碼時,標記確實顯示,

  • 我嘗試使用:taggable="false"
  • 我嘗試使用<template #tag></template>
  • 我還檢查了,它不是 CSS 隱藏它標簽仍在顯示。 在此處輸入圖像描述 是重現該問題的最少代碼。

Desired 行為不像示例中那樣顯示標記。

您應該使用<template slot="tag">{{ '' }}</template>來隱藏標簽。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM