S
S
semki0962019-03-06 14:50:03
Vue.js
semki096, 2019-03-06 14:50:03

How to properly pass object data from function to function, vuejs?

How to pass object from func1 to func2? I think I'm doing it wrong:

methods: {
func1: function (event) {
  Vue.myobject = объект;
  },

func2: function (event) {
  console.log(Vue.myobject);
  }
    ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Skorokhodov, 2019-03-06
@egor_sc

{
   data: ()=>({object: {}}),
   methods: {
     func1(){ this.object = объект }
     func2(){ console.log(this.object) }
   },
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question