复制文件到新环境时,要重新安装less和路由命令,
命令后面加--legacy-peer-deps
第一步(也可以试试:
npm i npm run serve(linux 环境用dev ))
1.eslint校验功能关闭 --在根目录下,创建一个vue.config.js const { defineConfig } = require('@vue/cli-service') module.exports = defineConfig({ transpileDependencies: true, lintOnSave:false }) 2.运行自动打开网站 在package.json "serve": "vue-cli-service serve --open --host=localhost"
3.安装less(输入命令)
cnpm install --save less less-loader@5
4.先想好css的功能(如清除默认样式,然后再引入) 例如在首页: index.html(head中)
5.组件模板
6.组件使用(引入、注册、使用)
7.安装路由(输入命令)
npm install --save vue-router
npm i --save vue-router@3.5.3(用这个)