App.vue 743 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <div style="overflow: hidden">
  3. <router-view/>
  4. </div>
  5. </template>
  6. <script>
  7. import {
  8. defineComponent,
  9. ref,
  10. getCurrentInstance
  11. } from 'vue'
  12. import {useStore} from 'vuex'
  13. import {ElConfigProvider} from 'element-plus'
  14. import zhLocale from 'element-plus/lib/locale/lang/zh-cn'
  15. export default defineComponent({
  16. name: 'App',
  17. components: {
  18. [ElConfigProvider.name]: ElConfigProvider //添加组件
  19. },
  20. setup() {
  21. const store = useStore()
  22. const locale = ref(zhLocale)
  23. const that = getCurrentInstance().appContext.config.globalProperties
  24. return {
  25. locale
  26. }
  27. }
  28. })
  29. </script>
  30. <style scope lang="scss">
  31. html, body {
  32. margin: 0;
  33. padding: 0;
  34. border: 0;
  35. width: 100%;
  36. height: 100%;
  37. }
  38. </style>