项目即将就结束了,闲来无事就打算把项目从开始到结束重新复盘一下,看看有没有能够优化的地方,毕竟自己使用都能感到比较生硬,
一、
先把公司提供的框架给解压,可以看到node_modules已经存在,不再需要npm i npm install来下载依赖,所以我就直接试试能不能运行起来。
npm run serve
果然不出所料,出问题了。
> newvue@0.1.0 serve
> vue-cli-service serve
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
INFO Starting development server...
98% after emitting SizeLimitsPlugin
ERROR Failed to compile with 1 error 下午4:31:01
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 14.x
Found bindings for the following environments:
- Windows 64-bit with Node.js 12.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
@ ./element-variables.scss 4:14-225 15:3-20:5 16:22-233
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.136.145:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
大概意思可能是:Node Sass和系统node版本不一致,并提示运行npm rebuild node-sass为当前环境下载绑定,然后我就运行了一遍,再npm run serve,运行成功!
还一种方法就是直接把node_modules文件夹给删掉重新重新npm i下载依赖。再npm run serve,也是可以成功的。
运行成功之后打开页面无法点击其他输入框,仔细一看才看到原来有一个全局loading加载动画,这个感觉有点不好。
loading单独写在了另一篇文章里,因为分为局部loading和全局loading,就单独写在了一篇里。
loading设置好以后,就开始看框架结构,看了一下框架首页是标准的后台管理系统的样式,左右布局,左边是菜单,右边是内容区域,但是一时间没看懂是怎么用路由来组成的。