jeudi 21 juillet 2022

What are possible patterns for vue3 component export function?

I'm developing vue 3 table component that will have data export feature. Table component can be nested and parent/higher level components should have ability to trigger export and receive underlying data.

One way to achieve this that comes to my mind is to reference table component from parent component level and call export methods directly on table component.

Another idea would be to watch one of the props which could be incremented and change would trigger export event.

Do you have experience with other patters for this scenario (expose component internal method / feature and consume result in parent component). Do you find any drawback of ideas listed above?

Best regards, It_man

Aucun commentaire:

Enregistrer un commentaire