<!--
 * @Author: your name
 * @Date: 2021-10-14 17:17:53
 * @LastEditTime: 2022-03-09 11:41:56
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \Foshan4A\src\App.vue
-->
<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
export default {
  name: 'App',
  watch: {
    $route: {
      // 监听路由变化 一级菜单时清除子路由缓存的数据
      handler: function (val) {
        const path = val.path.split('/')
        if (path.length <= 2) {
          sessionStorage.removeItem('collectionData')
          sessionStorage.removeItem('editIBMMQ')
        }
      },
      deep: true
    }
  }
}
</script>
