1.创建项目
npm init vite@latest
2.安装项目需要用到的依赖
npm install less
npm install vue-router
npm install element-plus
npm install @element-plus/icons-vue
设置路径别名
//路径别名
resolve: {
alias: [
{
find: "@",
replacement: "/src"
}
]
}
import "@/assets/less/index.less" 相当于直接定位到/src/assets/less/index.less
reset.less
div,
span,
h1,
h2,
h3,
h4,
h5,
h6,
p {
margin: 0;
padding: 0;
border: 0;
}
html,
body {
margin: 0;
padding: 0;
border: 0;
height: 100%;
width: 100%;
}
@import "./reset.less"; //在index.less中引用