billxu 发表于 2022-6-10 18:15:16

为什么vite不支持这种形式导入css样式[vite:css] Failed to find '~...

我在jeecg vue3中有这句:原句:

<style>
@import "~dhtmlx-gantt/codebase/dhtmlxgantt.css";
</style>
为什么vite不支持这种形式导入css样式???我在vue cli中可以正常运行???
Failed to find '~dhtmlx-gantt/codebase/dhtmlxgantt.css'in [    D:/idea-down/jeecgboot-vue3-master (1.2)/jeecgboot-vue3-master/src/components]file: D:/idea-down/jeecgboot-vue3-master (1.2)/jeecgboot-vue3-master/src/components/ganttone.vue?vue&type=style&index=0&lang.csserror during build:Error: Failed to find '~dhtmlx-gantt/codebase/dhtmlxgantt.css'





billxu 发表于 2022-6-10 20:57:58

这个问题已经解决:
改为:
<script>
@import "~dhtmlx-gantt/codebase/dhtmlxgantt.css";
</script>
即可
页: [1]
查看完整版本: 为什么vite不支持这种形式导入css样式[vite:css] Failed to find '~...