Forum

VUE3 - how to call ...
 
Powiadomienia
Wyczyść wszystko

VUE3 - how to call component method from root app.js

1 Wpisy
1 Użytkownicy
0 Reactions
776 Widoki
0
Rozpoczynający temat

example

1 odpowiedź
0
Rozpoczynający temat

1. It's not possible in easy way.  Read more here.

2. Use https://github.com/developit/mitt as separated event's lib.

 

Example code:

Emitter:

methods: {
	TestEmit() {
			this.emitter.emit('foo', { a: 'b' })
		}
	}	

Reciever:

   mounted() {
        this.emitter.on('foo', e => console.log('test ok!', e) 
    },

Twoja odpowiedź

Nazwa autora

E-mail autora

Twoje zapytanie *

 
Podgląd 0 rewizje Zapisano
Udostępnij: