App.vue 595 B

12345678910111213141516171819202122232425262728
  1. <template>
  2. <a-config-provider :locale="locale">
  3. <div id="app">
  4. <router-view/>
  5. </div>
  6. </a-config-provider>
  7. </template>
  8. <script>
  9. import { domTitle, setDocumentTitle } from '@/utils/domUtil'
  10. import { i18nRender } from '@/locales'
  11. export default {
  12. data () {
  13. return {
  14. }
  15. },
  16. computed: {
  17. locale () {
  18. // 只是为了切换语言时,更新标题
  19. const { title } = this.$route.meta
  20. title && (setDocumentTitle(`${i18nRender(title)} - ${domTitle}`))
  21. return this.$i18n.getLocaleMessage(this.$store.getters.lang).antLocale
  22. }
  23. }
  24. }
  25. </script>