Guys, I'm trying to create a loading...
, the problem is that when using the vue-xlsx-table library the method is almost closed since you can only access it once the file has been fully uploaded and processed.
<template>
<div id="app">
<h1>vue-xlsx-table</h1>
<vue-xlsx-table @on-select-file="handleSelectedFile"></vue-xlsx-table>
</div>
</template>
<script>
export default {
name: 'app',
methods: {
handleSelectedFile (convertedData) {
// Insert Loading
console.log(convertedData)
}
}
}
</script>
Has anyone previously used this library to convert
xlsx
(excel) formats toJSON
?
It seems that they are not maintaining the code for more than 2 years, but you can solve the problem in 2 ways, the first and more "intrusive" is to bring your component and modify it and the second is with an asynchronous component . The second option would be something like this:
For you to see an implemented solution I have created a sandbox with the first option:
You will see that there is a folder with the imported component vue-xlsx-table . Inside I have modified vue-xlsx-table.vue so that it has a loading variable and manages its state in the template:
and in the file handling method: