05 2021 档案

摘要: 阅读全文
posted @ 2021-05-28 16:21 yw3692582 阅读(37) 评论(0) 推荐(0)
摘要:首先封装 axios.js: // 引入 axios 和 qs(qs选择性引入) import axios from 'axios' import qs from 'qs' // 请求拦截:可以在header中统一添加token axios.interceptors.request.use( con 阅读全文
posted @ 2021-05-25 12:49 yw3692582 阅读(218) 评论(0) 推荐(0)
摘要:在组件中添加 name 属性: 在router-view(v-if="isRouterAlive" 不用写,我是出于业务需要才加的): 注意:如果不用 include,将默认所有通过 router-view 的渲染的页面都被缓存,而使用 include 则代表 name 属性相匹配的组件被缓存。 阅读全文
posted @ 2021-05-21 09:02 yw3692582 阅读(228) 评论(0) 推荐(0)
摘要:子组件: <template> <div> <!-- 树结构 --> <el-tree :data="treeData" @node-click="handleNodeClick" :default-expand-all="true" :props="defaultProps" > </el-tre 阅读全文
posted @ 2021-05-20 11:21 yw3692582 阅读(298) 评论(0) 推荐(0)
摘要:store.jsimport Vue from 'vue' import axios from 'axios' import Vuex from 'vuex' Vue.use(Vuex) const store = new Vuex.Store({ state: { userData: JSON.p 阅读全文
posted @ 2021-05-13 12:46 yw3692582 阅读(57) 评论(0) 推荐(0)
摘要:1、element-ui的按需引入 npm i element-ui -Snpm install babel-plugin-component -Dvue-cli2.x版本修改.babelrc文件(在后面统一贴代码)2、vant的按需引入 npm i vant -S npm i babel-plug 阅读全文
posted @ 2021-05-12 11:20 yw3692582 阅读(834) 评论(0) 推荐(0)
摘要:// 迭代器 Iteration() { /** * 适用场景: * 1、forEach: 适用用对数组进行操作,参考for循环 * 2、every:适用于对数组所有元素进行同一个判断,返回布尔值 * 3、some:适用于判断某个元素是否符合函数,返回布尔值 * 4、reduce:适用于对数组元素进 阅读全文
posted @ 2021-05-11 09:35 yw3692582 阅读(162) 评论(0) 推荐(0)