App.vue 661 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <div id="app">
  3. <keep-alive>
  4. <router-view v-if="$route.meta.keepAlive" />
  5. </keep-alive>
  6. <router-view v-if="!$route.meta.keepAlive" />
  7. </div>
  8. </template>
  9. <script>
  10. export default {
  11. data() {
  12. return {}
  13. },
  14. created() {
  15. console.log('助老')
  16. },
  17. }
  18. </script>
  19. <style>
  20. #app {
  21. font-family: Avenir, Helvetica, Arial, sans-serif;
  22. -webkit-font-smoothing: antialiased;
  23. -moz-osx-font-smoothing: grayscale;
  24. color: #2c3e50;
  25. height: 100%;
  26. }
  27. #nav {
  28. padding: 30px;
  29. }
  30. #nav a {
  31. font-weight: bold;
  32. color: #2c3e50;
  33. }
  34. #nav a.router-link-exact-active {
  35. color: #42b983;
  36. }
  37. </style>