提交 c1925303 authored 作者: matian's avatar matian

文件下载修改

上级 f8e6d2b8
......@@ -12,7 +12,7 @@
</app-frame>
</template>
<script>
import { saveAs } from 'file-saver'
// import { saveAs } from 'file-saver'
import appFrame from '@/components/appFrame'
export default {
......@@ -31,14 +31,12 @@ export default {
fileList: [
{
name: '招生简章.pdf',
url:
'https://webapp-pub.ezijing.com/project/marywood/%E6%8B%9B%E7%94%9F%E7%AE%80%E7%AB%A0.pdf?v=2',
url: 'https://webapp-pub.ezijing.com/project/marywood/%E6%8B%9B%E7%94%9F%E7%AE%80%E7%AB%A0.pdf?v=2',
icon: 'https://webapp-pub.ezijing.com/project/marywood/pdf.png'
},
{
name: '常见问题.pdf',
url:
'https://webapp-pub.ezijing.com/project/marywood/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98.pdf?v=3',
url: 'https://webapp-pub.ezijing.com/project/marywood/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98.pdf?v=3',
icon: 'https://webapp-pub.ezijing.com/project/marywood/pdf.png'
}
// {
......@@ -63,7 +61,10 @@ export default {
},
methods: {
download(item) {
saveAs(item.url, item.name)
var FileSaver = require('file-saver')
console.log(FileSaver.saveAs)
var file = new File([item.url], item.name, { type: 'application/pdf;charset=utf-8' })
FileSaver.saveAs(file)
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论