首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >vue-multiselect不加载CSS。

vue-multiselect不加载CSS。
EN

Stack Overflow用户
提问于 2017-03-19 14:27:13
回答 1查看 4.7K关注 0票数 3

我使用vue-多重选择组件(b15)和vue-cli (webpack模板),但是组件的CSS没有加载,组件呈现错误。有什么想法吗?

我的代码:

代码语言:javascript
复制
<template>
  <div>
      <div class="select2-container select2-container-multi full-width">
        <multiselect
          class="form-control form-control-select textarea" 
          :class="{ 'has-error': showError }"
          :options="localOptions"
          :label="labelKey"
          track-by="id"
          :multiple="multiple"
          :selected="value"
          :searchable="true"
          :placeholder="placeholder" 
          :loading="loading"
          :custom-label="formatLabel"
          :disabled="disabled"
          :readonly="readonly"
          @input="updateSelected"
          @close="blur">
        </multiselect>
      </div>
  </div>
</template>

<script>
import Multiselect from 'vue-multiselect'

export default {
  mixins: [inputMixin],

  components: {
    Multiselect
  }
}
</script>

呈现多重选择,并且没有应用任何样式。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-11-20 14:48:45

您需要在末尾单独添加css,因此您的文件如下所示:

代码语言:javascript
复制
<template>
  <div>
      <div class="select2-container select2-container-multi full-width">
        <multiselect
          class="form-control form-control-select textarea" 
          :class="{ 'has-error': showError }"
          @input="updateSelected"
          @close="blur">
        </multiselect>
      </div>
  </div>
</template>

<script>
import Multiselect from 'vue-multiselect'

export default {
  mixins: [inputMixin],
      components: {
    Multiselect
  }
}
</script>

<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42887724

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档