layout-user.vue 590 B

123456789101112131415161718192021222324252627282930
  1. <template>
  2. <div class="w-screen">
  3. <layout-user-header></layout-user-header>
  4. <div class="h-27px"></div>
  5. <div class="w-1200px flex m-auto">
  6. <layout-user-menu :currentPath="currentPath"></layout-user-menu>
  7. <div class="w-15px"></div>
  8. <div class="w-940px bg-white">
  9. <RouterView></RouterView>
  10. </div>
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. currentPath: this.$route.path,
  19. };
  20. },
  21. beforeRouteEnter(to, from, next) {
  22. next((vm) => {
  23. vm.currentPath = to.path;
  24. });
  25. },
  26. };
  27. </script>