cnpm install sass ---save
package.json
sass 版本^1.43.1
"devDependencies": {
"@vue/compiler-sfc": "^3.0.4",
"sass": "^1.43.4",
"vite": "^1.0.0-rc.13",
"vue-router": "^4.0.12"
},
index.vue
<style lang="scss" scoped>
#index{
width: 100%;
max-width: 768px;
height:100vh;
max-height: 1024px;
border: 1px solid red;
box-sizing: border-box;
font-size: 1rem;
margin: auto;
>div{
width: 200px;
background:pink;
}
}
</style>
tip
不需要安装
sass-loader
,node-sass