feat: 整合unocss

Former-commit-id: 043192a1a3
This commit is contained in:
haoxr 2023-02-26 23:56:28 +08:00
parent 8f3315ebe2
commit 1190ce349c
2 changed files with 8 additions and 1 deletions

View File

@ -15,6 +15,8 @@ import '@/styles/index.scss';
import 'element-plus/theme-chalk/index.css';
import 'element-plus/theme-chalk/dark/css-vars.css';
import 'uno.css';
const app = createApp(App);
// 自定义指令
import * as directive from '@/directive';

View File

@ -11,6 +11,8 @@ import IconsResolver from 'unplugin-icons/resolver';
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
import UnoCSS from 'unocss/vite';
import path from 'path';
const pathSrc = path.resolve(__dirname, 'src');
@ -30,7 +32,7 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
scss: {
javascriptEnabled: true,
additionalData: `
@use "@/styles/variables.module.scss" as *;
@use "@/styles/variables.scss" as *;
`
}
}
@ -54,6 +56,9 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
},
plugins: [
vue(),
UnoCSS({
/* options */
}),
AutoImport({
// 自动导入 Vue 相关函数ref, reactive, toRef 等
imports: ['vue', '@vueuse/core'],