Install the NPM I XLSX plug-in
2, sample
<template> <div class="home"> <div v-html="tableau"></div> </div> </template> <script> import axios from 'axios' import XLSX from "xlsx"; export default { data(){ return { tableau: null, } }, mounted(){ axios.get('/xlsx',{ responseType: Then (({data})=> {let workbook = xlsx. read(new Uint8Array(data)); {type:"array"}); Var worksheet = workbook.Sheets[workbook.SheetNames[0]]; This. Tableau = xlsx.utils.sheet_to_html (worksheet); // render})}} </script>
- The above method is simple to render into a table, and you need to modify the style yourself. For editing functions, see the XLSX API documentation