Vue adds the global component top, to App.vue, so how does the top component communicate with the routing page in < router-view > and pass a value

<template>
  <div id="app">
    <top-view/>
    <router-view/>
    <footer-view/>
  </div>
</template>

<script>

import top from "@/view/Top"
import footer from "@/view/Footer"

export default{
  name: "App",
  components:{
      TopView:top,
      FooterView:footer,
  }
}
</script>
<style lang="scss">
    @import "./src/assets/sass/style.scss";
</style>
Jun.18,2021

this is not a parent-child component. It is better to use eventbus and state management vuex .


  1. vuex
  2. bus bus
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb2cd2-481c7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb2cd2-481c7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?