Answer the question
In order to leave comments, you need to log in
How to get data from the vue js component in the main application?
I have a component, javascript variable, suggestion:
Vue.component('addressmd', {
mounted: function () {
suggestion = '123';
}
}
new Vue({
el: '#app',
data: {
suggestion:null,
}
});
Answer the question
In order to leave comments, you need to log in
Duck can it be easier to transfer to the component through props, and not from it? https://ru.vuejs.org/v2/guide/components-props.html
See the v-model.sync modifier for an example. Or maybe so. inside props component: {suggestion : {default: ()=> {}}}. And when updating the suggestion in the component this.$emit(suggestion)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question