Answer the question
In order to leave comments, you need to log in
Pass callback function through Vue constructor?
Hey!
How to pass callback function to Content component via new Vue constructor or any other property?
function callback() {
console.log('This is callback');
}
const vueModal = new Vue({
store,
render: h => h(Content),
});
vueModal.$mount('#wo-popup');
Answer the question
In order to leave comments, you need to log in
Well, you can do it through the plugin :
Conditional example:
function callback() {
console.log('This is callback');
}
Vue.use({
install(Vue) {
Vue.prototype.$callback = callback
}
})
{
someMethod() {
this.$callback(/* ... */)
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question