<template> <div > <el-button @click="openFile">下载文件</el-button> <el-button @click="openImg">下载图片</el-button> <router-view></router-view> </div></template><script>export default { name: "App", components: {}, data() { return {}; }, methods: { openFile() { //word excel 下载项目种本地资源 //window.location = `${process.env.BASE_URL}static/大.xlsx`; window.location = `${process.env.BASE_URL}static/静态文件.docx`; }, openImg1() { //下载图片 下载项目种本地资源 let request = new XMLHttpRequest(); let appUrl = `${window.location.protocol}//${window.location.host}/`; request.responseType = "blob"; let url = appUrl + `${process.env.BASE_URL}static/1.png`; request.open("GET", url); request.onload = functio