3π
β
The component emitting the event is the button and you are listening to the event on the scene component:
Change your App.vue like this :
<template>
<div id="app" class="container">
<scene ></scene>
<buttons @navigate="navigateTo" ></buttons>
</div>
</template>
<script>
import Scene from "./components/Scene.vue";
import Buttons from "./components/Buttons.vue";
export default {
name: "app",
methods: {
navigateTo(dest) {
console.log('received value', dest);
this.selectedScene = dest;
}
},
components: {
Scene,
Buttons
}
};
</script>
<style scoped>
</style>
π€M. Gara
Source:stackexchange.com