Vue
zhangyouxiu66
这个作者很懒,什么都没留下…
展开
-
el-tree异步加载
<el-tree ref="indicatorTree" node-key="treeId" :props="defaultProps" :data="rightTreeData" lazy :load="loadNode" show-checkbox :default-expanded-k...原创 2022-03-28 22:02:10 · 661 阅读 · 1 评论 -
前端Vue下载文件
1. 第一种 exportProjectListExcel(params).then((response) => { // 传参调接口获取blob文件 if (response) { // respone为blob类型 let exportFileName = "项目检索列表.xlsx"; this.download(response, exportFileName); ...原创 2022-03-28 21:58:07 · 313 阅读 · 0 评论 -
vue导出文件
exportProjectListExcel(params).then((response) => { // 调接口传参获取blob if (response) { let exportFileName = "项目检索列表.xlsx"; this.download(response, exportFileName); } }); ...原创 2022-03-21 16:05:07 · 1485 阅读 · 0 评论 -
Vuex的核心概念之getter
Getter用于对Store中的数据进行加工处理形成新的数据 它只会包装Store中保存的数据,并不会修改Store中保存的数据,当Store中的数据发生变化时,Getter生成的内容也会随之变化 打开store.js文件,添加getters,如下:export default new Vuex.Store({ ....... getters:{ //添加了一个showNum的属性 showNum : state =>{ return '最新的count值为:...原创 2021-09-09 22:14:16 · 142 阅读 · 0 评论 -
Vuex的核心概念之Action
1.在mutations中不能编写异步的代码,会导致vue调试器的显示出错。 在vuex中我们可以使用Action来执行异步操作。2.打开store.js文件,修改Action,如下:actions: { addAsync(context,step){ setTimeout(()=>{ context.commit('add',step); },2000) }}然后在Addition.vue中给按钮添加事件代码如下:<button @...原创 2021-09-09 22:05:31 · 440 阅读 · 0 评论 -
Vuex的核心概念之Mutation
1.mutation用于变更store中的数据,不可以直接操作store中的数据;2.通过mutation这种操作方式可以集中监控所有数据的变化,便于后期维护;//定义mutationconststore =newVuex.store({ state: { count: 0;},mutations: { add(state) { ...原创 2021-09-09 21:54:15 · 290 阅读 · 0 评论