A
A
Alex2019-10-15 19:04:09
Vue.js
Alex, 2019-10-15 19:04:09

How to call a method from the root vue instance?

Hello, I'm learning vue.
The documentation says

// Вызов методов корневого экземпляра
this.$root.baz()

But how to register in the child?
methods: {
this.$root.baz()

        }

but something is wrong)) tell me thanks.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Michael, 2019-10-15
@astrodeep

methods: {
  method1() {
    this.$root.baz()
  }
}

M
Miki06, 2019-10-16
@Miki06

Alex , This is the first time I've heard about localstorage requests, any user can view and change them

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question