📜  vue js 从节点模块导入 css - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:42.283000             🧑  作者: Mango

代码示例1
// To import global CSS, simply import the stylesheet in main.js or App.vue, 
// where it is easy to reference all global styles in one main file 
// (or create a styles-import.js file and import that file in your main.js file).

// main.js
import '~/assets/styles.css';

// To import css scoped to a component, we can't just @import within a scoped style element,
// as they will leak out.
// Instead, we need to dedicate an entire scoped style element to importing that file.

// Component.vue
// Do this: