随笔分类 -  重写vue2之路

摘要:接口数据 获取: 存储: 渲染: 渲染.值: hidden:true v-if: 动态绑定图片: 子路由的遍历: 阅读全文 »
posted @ 2022-11-22 14:19 Cherishe 阅读(15) 评论(0) 推荐(0) 编辑
摘要:创建路由组件: .... 配置模块路由: 改进: 改进: 重定向: 统一改进: 路由模块: 阅读全文 »
posted @ 2022-11-22 13:43 Cherishe 阅读(15) 评论(0) 推荐(0) 编辑
摘要:创建组件: 导入-注册-使用组件: home样式: 使用组件: Header组件token 样式: 阅读全文 »
posted @ 2022-11-22 13:04 Cherishe 阅读(17) 评论(0) 推荐(0) 编辑
摘要:普通方式: 全局表单验证完成后要做的事情 200-token-username-message-push: 把这个登录封装成api进行调用 api封装: Login页使用api: 登录页: el样式调控: 404: 组件: 路由: 样式未出现: 阅读全文 »
posted @ 2022-11-22 12:51 Cherishe 阅读(3) 评论(0) 推荐(0) 编辑
摘要:axios封装: 配置代理: axios封装: axios的二次封装: 请求拦截统一token处理: 引入: 使用: 导入: 响应拦截统一错误处理: 导入: main.js: login页面: 效果:请求: 我们要请求的是: 阅读全文 »
posted @ 2022-11-21 20:55 Cherishe 阅读(101) 评论(0) 推荐(0) 编辑
摘要:接口说明: postman验证: 401:(没有携带token): 需要携带token进去~通过验证 postman: 阅读全文 »
posted @ 2022-11-21 20:20 Cherishe 阅读(22) 评论(0) 推荐(0) 编辑
摘要:封装校验: 用户名匹配: 登录校验封装: 导入模块:(按需导入) 使用封装名称: 封装token:设置-获取-删除 导入token: 使用token: 阅读全文 »
posted @ 2022-11-21 20:08 Cherishe 阅读(52) 评论(0) 推荐(0) 编辑
摘要:登录页在全局表单验证中获取ajax数据: 200证明接口数据请求成功: 数据请求成功后就可以利用状态码200:(登录成功:200)来存储用户信息,提示成功并跳转到首页 捕获异常: 效果: 优化rules: 正则插件:方便写正则(any-rule) 使用F1+输入校验的事物+回车 校验: 规则: 密码 阅读全文 »
posted @ 2022-11-21 19:26 Cherishe 阅读(17) 评论(0) 推荐(0) 编辑
摘要:登录组件: src/components/Login.vue 基本的模板 + el-card + el-form el-card的改造: el-form改造: data中准备form的基本数据字段: 密码框: src/router 登录路由: 构建路由:进行搭配: 一进到页面重定向到登录页+别人想访 阅读全文 »
posted @ 2022-11-21 19:01 Cherishe 阅读(26) 评论(0) 推荐(0) 编辑
摘要:src/router 路由懒加载: 路由异步组件: 阅读全文 »
posted @ 2022-11-21 18:22 Cherishe 阅读(13) 评论(0) 推荐(0) 编辑
摘要:1.安装axios: cnpm i axios -S 2.启动项目: yarn serve npm run serve 3.在全局main.js导入axios: import axios from 'axios' 4.挂载至原型(作用:全局使用): Vue.prototype.axios = axi 阅读全文 »
posted @ 2022-11-21 14:34 Cherishe 阅读(484) 评论(0) 推荐(0) 编辑
摘要:1.安装图标库: cnpm i -D font-awesome 2.启动项目: yarn serve 3.在main.js导入图标库: import 'font-awesome/css/font-awesome.min.css' 4.在组件中使用: 图库地址: https://fontawesome 阅读全文 »
posted @ 2022-11-21 13:23 Cherishe 阅读(66) 评论(0) 推荐(0) 编辑
摘要:scss的安装和使用: 1.安装: cnpm i sass-loader@7 node-sass@4 -S 2.使用: less的安装和使用: 1.安装: cnpm i less@3 less-loader@7 -S 2.使用: 运行: npm run serve/dev yarn serve/de 阅读全文 »
posted @ 2022-11-21 13:12 Cherishe 阅读(37) 评论(0) 推荐(0) 编辑
摘要:全局配置: 1.导入: main.js全局引入element-ui: import ElementUI from "element-ui" 2.注册: 使用Vue注册element-ui: Vue.use(ElementUI) 3.使用:(任何组件中使用element-ui组件) 按钮 el-but 阅读全文 »
posted @ 2022-11-21 12:57 Cherishe 阅读(1090) 评论(0) 推荐(0) 编辑
摘要:npm i webpack -g # 安装webpack npm i vue-cli -g # 安装脚手架 vue init webpack demo # 创建项目 全局安装 vue-cli 和项目创建 npm install -g @vue/cli # 用npm安装脚手架 or yarn glob 阅读全文 »
posted @ 2022-11-21 12:31 Cherishe 阅读(157) 评论(0) 推荐(0) 编辑
摘要:文件说明 npm init -y #初始化项目依赖文件 cnpm i -D @vue/cli #安装脚手架 npx vue -V #查看vue-cli版本号 npx vue create project-one #创建项目 #or npx v 项目启动 yarn serve 项目配置 vue.con 阅读全文 »
posted @ 2022-11-21 00:28 Cherishe 阅读(259) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示