You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

2.0 KiB

hz_ordersystem-lite

开发环境初始化

安装nodejs https://nodejs.org/zh-cn/

修改缓存目录,设置cache、prefix,在cmd下操作:
npm config set cache "e:\nodejs\cache"
npm config set prefix "e:\nodejs\prefix"
执行完关闭当前cmd需要关闭,才会生效。

使用命令可以查看配置状态:
npm config ls


设置windows全局环境变量Path,步骤: 我的电脑右键属性->高级系统设置->高级->环境变量->系统变量-Path(双击),新建两条记录:
e:\nodejs\prefix
e:\nodejs\prefix\node_modules

进入cmd,执行下面命令安装初始化环境
npm i -g @vue/cli @quasar/cli

环境配置安装:
npm i -g nrm
配置公司私有源
nrm add co http://nas.hzdl.biz:14873
nrm use co

恢复项目依赖

npm install

恢复后,如果项目运行失败,执行cmd删除目录命令,删除node_modules,再重新执行
npm install
rd /s /q node_modules


依赖包安装
## Project setup

npm install,简写 npm i


运行开发模式
### Compiles and hot-reloads for development

npm run serve


编译打包
### Compiles and minifies for production

npm run build


### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

安装 Vue
npm install -g @vue/cli
# OR
yarn global add @vue/cli

vue invoke / vue add / vue upgrade
vue add router,vue add vuex


<!-- 常见问题集锦 -->
1.如何开启程序内的log日志,如vconsole
src/boot/util.js 文件里 打开VConsole

2.如何开启懒加载
引入 vue-lazyload,替换文件路径

3.安装依赖包 yarn
npm i -g yarn  如遇权限问题,需加上 --unsafe-perm
windows下打开powershell,查看:get-executionpolicy,更改:set-executionpolicy remotesigned

4.防止图片变形
mode="aspectFill"

5.小程序与H5的相互调用
/static/utils/util_manager.js 

6.消息推送
signalR

7.深拷贝
/src/static/utils/index.js  deepCopy