no message
Former-commit-id: 684be8262ac4ab6c8c1657b30a36ab77106a0f4e Former-commit-id: 3d4da83c6d5a2a6dbfdbf87f205aad3e88660df0 Former-commit-id: 8c8b222f8eeac2d47af25cf3e5dd860b85076b9a
This commit is contained in:
@@ -48,8 +48,17 @@ export default {
|
||||
},
|
||||
txt (params) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// 默认值
|
||||
const paramsDefault = {
|
||||
text: '',
|
||||
title: 'text'
|
||||
}
|
||||
// 合并参数
|
||||
const _params = Object.assign({}, paramsDefault, params)
|
||||
console.log(typeof _params.text)
|
||||
// 导出
|
||||
const blob = new Blob(['Hello, world!'], {type: 'text/plain;charset=utf-8'})
|
||||
FileSaver.saveAs(blob, 'hello world.txt')
|
||||
FileSaver.saveAs(blob, _params.title + '.txt')
|
||||
// 完成
|
||||
resolve()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user