<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>excel 文件上传</title>
</head>
<body>
<input
type="file"
@click="e => {e.target.value = '';} "
@change="sendFiles"
/>
<script src="https://cdn.staticfile.org/vue/3.2.36/vue.global.min.js"></script>
<script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
<script>
let { createApp, reactive, toRefs, ref, onMounted, getCurrentInstance } =
Vue;
// Object.assign(window, Vue);
const app = createApp({
setup() {
function sendFiles(files) {
console.log("触发发送文件change");
// const reader = new FileReader();
// const file = files[0];
// reader.readAsArrayBuffer(file);
// reader.onload = function (e) {
// console.log(e.target.result);
// axios.post("/uploadExcel/" + file.name, {
// file: e.target.result,
// });
// };
}
onMounted(() => {});
return {
sendFiles,
};
},
});
</script>
</body>
</html>
忘了要挂载啥的了