Vuejs2 vue multiselect不加载CSS
我将组件(b15)与vue cli(网页包模板)一起使用,但未加载组件的CSS,并且组件呈现错误。有什么想法吗 我的代码:Vuejs2 vue multiselect不加载CSS,vuejs2,vue-component,Vuejs2,Vue Component,我将组件(b15)与vue cli(网页包模板)一起使用,但未加载组件的CSS,并且组件呈现错误。有什么想法吗 我的代码: <template> <div> <div class="select2-container select2-container-multi full-width"> <multiselect class="form-control form-control-select text
<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>
从“vue Multiselect”导入Multiselect
导出默认值{
mixin:[inputMixin],
组成部分:{
多选
}
}
Multiselect被渲染,所有内容都没有应用任何样式。您需要在末尾单独添加css,因此您的文件如下所示:
<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>
从“vue Multiselect”导入Multiselect
导出默认值{
mixin:[inputMixin],
组成部分:{
多选
}
}
少量代码可能有助于提供解决方案。您是否也可以添加相关的CSS。哪种CSS?组件中内置的组件本机CSS没有为我加载…有错误
应该是CSS类。它是。它只是一个实用程序类,如果表单有错误,就会应用get。。。我的问题与我的应用程序逻辑无关。那很好。我的问题是multiselect组件没有加载自己的样式。。。。如.multiselect.*