0

I am use vue.js to create my website. Now I want to load .xlsx file from the folder. All the solutions online is telling me using input type to upload file. But what I actually want to do is that the website will load the data from .xlsx file which is already local in my server folder. Just like you import other vue components and use it. How do I implement it?

  • https://stackoverflow.com/a/37083658/6555780 possible duplicate of this? You'll basically want to use a library to convert xls in to JSON for use in your application, could just use a method similar to this in your mounted/created hook then assign the output json to data – Rixcy May 01 '19 at 13:21
  • No, is not the same question. The one you post is focus on handle .xlsx file. The main problem is that , all the answer are saying use to get the file. But that is not what I want to do. I want to load the file ,just like you can use , one can directly import this image from the same folder. I don't know the logic why one can import image directly, but can't not import .csv file. – Lin Yu Syuan Sean May 01 '19 at 14:25
  • the answer I linked to isn't asking for an input, it's just doing the processing. you should be able to pass a file path to that function, like `parseExcel('./some_excel.xlsx')` – Rixcy May 02 '19 at 11:37

0 Answers0