上一页 1 2 3 4 5 6 7 8 ··· 11 下一页
摘要: require.context require.context是webpack中用来管理依赖的一个函数,此方法会生成一个上下文模块,包含目录下所有的模块的引用,同构正则表达式匹配,然后require进来 使用场景 我们在一个业务模块的list中要使用components下所有组件,手动一个一个引入如 阅读全文
posted @ 2020-07-28 22:18 荣光无限 阅读(7490) 评论(0) 推荐(0) 编辑
摘要: 普通排序 const arr = [] arr.sort((x, y) => x.prop - y.prop) 中文属性值排序 const arr = [] arr.sort((x, y) => x.typeName.localeCompare(y.typeName)) 阅读全文
posted @ 2020-07-28 16:26 荣光无限 阅读(840) 评论(0) 推荐(0) 编辑
摘要: el-table中单选的实现 引用场景: 选择单条数据进行业务操作 实现方式: 给el-table-column设置el-radio Template 代码 <div class="result-container"> <el-table :data="producList" border> <el 阅读全文
posted @ 2020-07-28 11:20 荣光无限 阅读(5061) 评论(0) 推荐(0) 编辑
摘要: 安装yrm npm install -g yrm 列出当前可用的镜像源 # yrm ls npm https://registry.npmjs.org/ cnpm http://r.cnpmjs.org/ taobao -- https://registry.npm.taobao.org/ nj h 阅读全文
posted @ 2020-07-27 09:36 荣光无限 阅读(435) 评论(0) 推荐(0) 编辑
摘要: nrm: npm registry manager npm 镜像源管理工具 安装nrm npm install -g nrm 查看所有的镜像源 nrm ls # nrm ls npm https://registry.npmjs.org/ * yarn https://registry.yarnpk 阅读全文
posted @ 2020-07-24 16:15 荣光无限 阅读(471) 评论(0) 推荐(0) 编辑
摘要: 严格模式 import getters from './getters' import mutations from './mutations' import actions from './actions' export default new Vuex.Store({ strict: true, 阅读全文
posted @ 2020-07-24 13:10 荣光无限 阅读(999) 评论(0) 推荐(0) 编辑
摘要: 定义 process.env的时机 如果已经提取了公共配置文件 webpack.common.js 分别定义了开发配置webpack.dev.js和生产配置webpack.prod.js 在webpack.common.js 合并 选项时的 plugins中使用插件DefinePlugin cons 阅读全文
posted @ 2020-07-24 11:18 荣光无限 阅读(342) 评论(0) 推荐(0) 编辑
摘要: mapAction-store中的异步方法 import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) export default new Vuex.Store({ state: { msg: 'Hello world', count: 阅读全文
posted @ 2020-07-24 10:39 荣光无限 阅读(12668) 评论(0) 推荐(0) 编辑
摘要: mapMutation-store中的同步方法 import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) export default new Vuex.Store({ state: { msg: 'Hello world', count 阅读全文
posted @ 2020-07-24 10:20 荣光无限 阅读(1607) 评论(0) 推荐(0) 编辑
摘要: getter相当于Vuex中的计算属性 对 state 做处理再返回 mapGetters 把 Store 中的 getters 映射到组件中的计算属性中 Store文件 import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) expo 阅读全文
posted @ 2020-07-23 23:49 荣光无限 阅读(2702) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 11 下一页