App.vue 892 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <div id="app">
  3. <router-view />
  4. </div>
  5. </template>
  6. <script>
  7. import { updateDocumentTitle } from '@/utils/document-title-util';
  8. import { getPageList } from '@/api/saleOrder';
  9. export default {
  10. name: 'App',
  11. created() {
  12. console.log(
  13. '我是-----------eom----应用------------------------------------'
  14. );
  15. // 恢复主题
  16. this.$store.dispatch('theme/recoverTheme');
  17. // getPageList({ status: [1], size: 10, pageNum: 1 });
  18. },
  19. methods: {
  20. /* 路由切换更新浏览器标题 */
  21. setDocumentTitle() {
  22. updateDocumentTitle(
  23. this.$route,
  24. (key) => this.$t(key),
  25. this.$store.state.theme.tabs
  26. );
  27. }
  28. },
  29. watch: {
  30. '$i18n.locale'() {
  31. this.setDocumentTitle();
  32. },
  33. $route() {
  34. this.setDocumentTitle();
  35. }
  36. }
  37. };
  38. </script>