laravel - Laravel Vue 未考虑 Core-ui 样式
问题描述
我尝试在 laravel vue js 项目中集成 coreui 管理模板,我克隆了 coreui vue 管理模板并在运行时运行良好,然后我在我的 laravel vue js 项目中安装了 coreui 的所有依赖项,在我的 app.js 上我已经进口的coreui:
import CoreuiVue from '@coreui/vue'
Vue.use(CoreuiVue)
在我的组件上,我只是测试集成侧栏。下面的结果除外(这个是从 coreui vue admin 模板克隆的) 我的组件看起来像
<template>
<div class="c-app">$
<CSidebar>
<CSidebarBrand class="d-md-down-none" to="/">
<CIcon
class="c-sidebar-brand-full"
name="logo"
size="custom-size"
:height="35"
viewBox="0 0 556 134"
/>
<CIcon
class="c-sidebar-brand-minimized"
name="logo"
size="custom-size"
:height="35"
viewBox="0 0 110 134"
/>
</CSidebarBrand>
<CRenderFunction flat :content-to-render="$options.nav"/>
</CSidebar>
</div>
</template>
<script>
import nav from '../component/containers/_nav';
export default {
nav,
computed: {
show () {
return this.$store.state.sidebarShow
},
minimize () {
return this.$store.state.sidebarMinimize
}
}
}
<style lang="scss">
@import '../../../assets/scss/style'; // this the scss style from core ui
</style>
在我的 package.json 上有依赖项
"@coreui/coreui": "^4.0.1",
"@coreui/icons": "^2.0.1",
"@coreui/utils": "^1.3.1",
"@coreui/vue": "^3.2.11",
"@coreui/vue-chartjs": "^1.0.6",
所以在 App.vue 上的克隆项目上,我测试了对 scss 导入的注释,我得到了与我的项目相同的结果,就像不考虑 style.scss 一样,我试图把所有的 css 代码(从 app.css 编译)在组件的样式上,但我得到了相同的结果。
解决方案
我刚刚遇到了与 CoreUI 相同的问题。最后我发现我和你一样使用 @coreui/coreui": "^4.0.1" ,但是所有的文档和示例都引用了库的 3.4 版本。安装这个版本解决了我的问题。
推荐阅读
- amazon-web-services - 无法从 S3 读取 csv 到 AWS 上 EC2 实例上的 pyspark 数据帧
- java - 单击按钮时 setOnClickListener 没有响应
- python - 用时间计算显示负小时数?
- sql-server - 将 HH:MM:SS 批量转换为秒并更新
- spring-boot - 实体上的 Spring 数据 JPA 自联接。如何指定递归深度?
- javascript - 如何使用 docker-container 运行网络应用程序?
- git - 我尝试使用 git 返回之前的提交,但现在一些 node_modules 无法正常工作。这是为什么?
- arrays - 动态分配字符串数组
- mysql - 对本机函数“JSON_OBJECT”的调用中的参数计数不正确
- ios - 如何解决核心数据崩溃?