#Function in component

18 messages · Page 1 of 1 (latest)

dawn basin
#

how can I run a function from a components.vue file from any pages.vue file?

#

or any function from any other file.

summer remnant
#

what is the problem exactly?

#

whas is the problem with directly calling it?

#

oh you define your function in a component?

dawn basin
summer remnant
#

probably It's better to define that function in a other file

dawn basin
summer remnant
#

If you need that data in multiple places then use a store

#

like pinia

#

I don't know if it's possible to export functions defined in components but even If it's I've never seen someone do it

#

so probably not good idea either

dawn basin
#

hm ok then ill find another way

summer remnant
#

use pinia

hexed pewter
#

or events ?

summer remnant
#

oh yeah that would work too

#

but probably they are in seperate places

#

I don't think he can do prop drilling