vue 导出功能
2023-09-11 14:22:18 时间
_createElement (entries) { let { tag, attr } = entries let node = document.createElement(tag) for (let key in attr) { node.setAttribute(key, attr[key]) } return node // fn && fn(node) // // 返回值只为了做测试用例 // return node ? true : false }, openForm (url, params, method) { console.log(url, params, method) const form = this._createElement(({ tag: 'form', attr: { id: 'newsForm', name: 'newsForm', target: '_blank', method: method, action: url } })) Object.keys(params).forEach(item=>{ let input = document.createElement('input') input.type = 'text' input.name = item input.value = params[item] form.appendChild(input) }) console.log(form) document.body.appendChild(form) form.submit() document.body.removeChild(form) }, // 导出 exportData () { const url = `${globalDefine.POST_URL}/manage/data/statistics/follow/export/${this.type}` this.openForm(url, this.params, "POST") },
相关文章
- Vue笔记:Vue3 Table导出为Excel
- vue项目中抽离.vue文件中的js代码
- [Vue] Get up and running with vue-router
- [Vue @Component] Simplify Vue Components with vue-class-component
- [Vue + TS] Create your own Decorators in Vue with TypeScript
- [Vue] Get up and running with vue-router
- vue.js3: 自定义video可拖动的进度条(vue@3.2.36)
- vue.js 3.2.20:拖动创建div及移动、缩放、删除等操作
- vue中mixins和组件的区别和用法
- vue-ant design示例大全——按钮本地css/js资源
- 看大神如何使用vue导出pdf
- vue3.0 没有 vue.condig.js 解决
- 前端框架Vue------>第一天学习(3)
- vue中如何将 json 格式化展示在页面中?
- vscode自定义vue模板代码
- 201:vue+openlayers:加载geojson文件形成围栏,可添加、修改、删除feature,导出geojson
- 178:vue+openlayers 绘制自定义图形,导出为geojson文件
- Vue(一)vue 概述与用法、MVVM、绑定语法、vue 指令
- vue-tour快速入门:VUE项目中如何使用vue-tour新手引导指引插件?怎样使用?包含具体实例
- Vue学习笔记——Vue核心
- 【问题系列】vue当编辑框被触发就出现保存按钮