# Vue实战项目:电商管理系统(Element-UI) **Repository Path**: zhangswGitee/Element-UI ## Basic Information - **Project Name**: Vue实战项目:电商管理系统(Element-UI) - **Description**: 2019.12.23开始 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2021-05-17 - **Last Updated**: 2021-07-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # vuexoms > A Vue.js project ## Build Setup ``` bash # install dependencies npm install # serve with hot reload at localhost:8080 npm run dev # build for production with minification npm run build # build for production and view the bundle analyzer report npm run build --report ``` For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 20-Vue实战项目:电商管理系统(Element-UI) --https://www.bilibili.com/video/av74592164?p=5 1.配置码云仓库,生成公匙(ssh) 你的公匙已经生成并保持到C:\ Your public key has been saved in C:\Users\dxf/.ssh/id_rsa.pub. Git git init 仓库初始化 git status 查看状态 git add .提交到暂存区 git commit -m '相关注释文字' 将文件添加到仓库 git remote add origin https://gitee.com/john0/Element-UI.git [本地仓库和远程仓库建立连接] git push origin master 将本地代码提交到远程仓库 git checkout -b login 创建一个叫login的分支(branch) git branch 查看分支 Git 远程仓库clone时 密码输错了 如何修改 控制面板-用户账户-凭据管理器 element ui为按需导入,你需要哪些组件,必须先导入(和layui一致) 使用font-class的方式引用图标(阿里图标库生成图标文件) v-bind 简写: 动态地绑定一个或多个特性 v-on 简写@ 用于监听DOM事件 v-model 数据双向绑定 在表单控件或者组件上创建双向绑定(通过他实现数据绑定) login表单 1.通过属性绑定,绑定rules校验对象 2.在data数据中定义rules校验对象,每一个属性都是一个校验规则 3.不同的表达item项,通过prop来指定验证规则 拿到表单的login表单的实例对象: ref="loginFormRef" <-------**** 使用axios发起请求 请求返回为promise,则我们可以使用async await来简化操作。<---*** await只能用来被async修饰的方法中 权限验证模块 1.将登陆成功放回的token保存到客户端的sessionStorsge中 2.项目中只有登陆api可以无身份访问(无token) 3.token只应在当前网站打开期间有效,所有存在sessionStorsge中 4.通过编程式导航跳转到后台主页,路由地址是 /home 为什么保存到sessionStorsge,而不是loaclStoreage? loaclStoreage是持久的存储机制,sessionStorsge是会话期间的存储机制 退出 基于token的退出比较简单,只要销毁本地token。 这样后续访问就不会携带token了。 有一个新页面 1. 如home.vue 需要给他配置到路由上面去 处理eslint和格式化文档之间的错误 新建 .prettierrc文件 错误 1.vscode打开文件位置错误,导致npm run dev 失败