天天看点

vue 3 安装scss

pnpm install node-sass sass-loader sass -D
           

vite.config.js文件里添加

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  pluginOptions: {
    'style-resouces-loader': {
      preProcessor: 'scss',
      patterns: []
    }
  }
})
           

页面里添加

<style  scoped>
.homePage {
	header {
		height: 80px;
	}
}
</style>
           

继续阅读