Answer the question
In order to leave comments, you need to log in
How to pass data between Vue components?
app.js file:
window.Vue = require('vue');
import VueResource from 'vue-resource';
Vue.use(VueResource);
import Vuex from 'vuex';
Vue.use(Vuex);
Vue.component('comment-box', require('./components/CommentBox.vue'));
Vue.component('info-box', require('./components/InfoBox.vue'));
const app = new Vue({
el: '#app'
});
<template>
<div :class="[{ isActive }, snackbars]" id="form-output-global">
{{message}}
</div>
</template>
methods: {
show(message){
isActive = true,
message = сообщение отправлено
}
}
Answer the question
In order to leave comments, you need to log in
Thanks to all ! Found here https://habr.com/post/332628/ an example. What I needed!
Or pass it to child components through props through a unidirectional connection, and pass it to the parent through events. Or use the VueX store, and get data using getters, and change using mutations.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question