gpt4 book ai didi

vuejs2 - vue-multiselect 不加载 CSS

转载 作者:行者123 更新时间:2023-12-01 23:15:56 25 4
gpt4 key购买 nike

我正在使用vue-multiselect组件(b15)与vue-cli(webpack模板)但​​组件的CSS未加载并且组件渲染错误。有什么想法吗?

我的代码:

<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>

多选已渲染,所有内容均未应用样式。

最佳答案

您需要在末尾单独添加 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>

关于vuejs2 - vue-multiselect 不加载 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42887724/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com