M
M
Mantikor132018-02-07 00:09:19
Vue.js
Mantikor13, 2018-02-07 00:09:19

How to access Vue instance from outside?

Hello, please tell me how to call a Vue instance method from outside. Tried mainVue.$options.methods, doesn't work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dima Polos, 2018-02-07
@Mantikor13

I did this:

let myVue = new Vue({
     el: "#app",
     data:  {},
     methods: {
       some(){
       console.log(1);
    }
  }
});
myVue.some();

https://jsfiddle.net/Lhfzcf1k/
Do you really need to?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question