joaomede / vue3-xlsx

XLSX manipulation made easy by Vue.js 3 (next) - (fork vue-xlsx)
https://joaomede.github.io/vue3-xlsx/
MIT License
12 stars 3 forks source link

Styling headings #1

Closed nahojj closed 2 years ago

nahojj commented 3 years ago

Hi,

First of all, nice wrapper! Is it possible to style the headings with font-weight so the labels don't float together with the columns?

Now it's a bit hard to see the actual labels and the column width is also a bit tiny.

joaomede commented 3 years ago

Hello @nahojj , Thank you.

About this lib: it is an adaptation for "Vue 3" of an existing version for "Vue 2" https://www.npmjs.com/package/vue-xlsx

About your doubt; this lib uses in the background a lib called "xlsx", its documentation is here; https://www.npmjs.com/package/xlsx.

When you want to generate an XLSX from a JSON, the "json_to_sheet" method of the "xlsx" lib is called in the background, so you can consume the official "xlsx" documentation to understand the possibilities of the "vue3-xlsx" lib .

nahojj commented 2 years ago

@joaomede Can you please provide an example of what you are meaning? I understand I can use and hijack into the official package but not how I should write this in Vue.

joaomede commented 2 years ago

@nahojj When you declare <xlsx-sheet>, you pass a prop, called "collection", this property needs to meet 2 types of structure, because the library under the hood, if called "xlsx", and in the documentation it talks about 2 methods

"aoa_to_sheet" "json_to_sheet"

So the JSON structure is the second method; in this case, "json_to_sheet", if you look at this link "https://www.npmjs.com/package/xlsx" about this method (json_to_sheet) or (aoa_to_sheet), you will see several possibilities of use, including styling.

To make it clear, under the hood "things" happen, and these things belong to the "xlsx" library, this project here makes a wrapper on top of this "xlsx" library and it respects the entries, so many things under the hood can be done, feel free to study the "xlsx" package and test various possibilities.

obs: be sure to read the components of this project to understand how properties are received, this can help you

nahojj commented 2 years ago

@joaomede Thanks! I'll try the collection prop and hijack me from there down to xlsx.