- Mixed spaces and tabs 缩进不能空格和tab混和用,语法检查会报错。
- @代表 src 目录,publicPath 配置。
- nvm 安装后的 环境变量 D:\nvm\nvm\npm
- vue.config.js 需要手动添加,配置项目路径
- .vuerc 文件改为 false 不使用淘宝镜像
- vue-cli 淘宝镜像 npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver
- npm cache clean --force 清除npm缓存
- 使用 nrm 更换淘宝镜像
- npm install --registry=https://registry.npm.taobao.org --loglevel=silly:
- 新建一个项目命令: vue create vue-test
- 新建一个项目配置说明: https://blog.csdn.net/m0_37285193/article/details/82703022
1. babel
2. TypeScript
3. Progressive Web App (PWA) Support 支持渐进式网页应用程序
4. Router 路由管理器
5. Vuex 状态管理模式(构建一个中大型单页应用时)
6. CSS Pre-processors css预处理
7. Linter / Formatter 代码风格、格式校验
8. Unit Testing 单元测试
9. E2E Testing E2E(End To End)即端对端测试
- vue.config.js
+ 配置项目路径, 路由方式, 多页面应用等信息。
- publicPath
+ 3.3+ 使用
+ 当使用基于 HTML5 history.pushState 的路由时不能使用 './', 应使用绝对路径。
+ 当使用 pages 选项构建多页面应用时不能使用 './', 应使用绝对路径。
- vue-router 报错
+ Failed to resolve async component render: TypeError: Cannot read property '$createElement' of undefind
- components 去掉 s 改成 routes: [{ path: '/', name: 'HelloWorld',component: HelloWorld }]
- no-unused-vars: “/ eslint-disable no-unused-vars /” 这个规则报错, 组件定义了但没有被使用。
- Module not found: Error: Can't resolve: 缺少依赖,npm 下载并引用
- vue-cli3.0 中一处了static 文件夹,新增了 public 文件夹,不要再找 static 拉。
- 开发时报 'sockjs.js' undefined 错误: dist:node_modules\sockjs-client\dist: 1604 self.xhr.send(payload);注释,避免启动服务时不停报错。
vue-cli 入坑指南
最新推荐文章于 2024-06-24 11:31:30 发布