App.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <a-config-provider :locale="locale">
  3. <div id="app">
  4. <router-view v-if="isShow" />
  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. isShow: true,
  15. }
  16. },
  17. computed: {
  18. locale() {
  19. this.reLoad()
  20. // 只是为了切换语言时,更新标题
  21. const { title } = this.$route.meta
  22. title && setDocumentTitle(`${i18nRender(title)} - ${domTitle}`)
  23. return this.$i18n.getLocaleMessage(this.$store.getters.lang).antLocale
  24. },
  25. },
  26. methods:{
  27. reLoad(){
  28. this.isShow = false
  29. this.$nextTick(() => {
  30. this.isShow = true
  31. })
  32. }
  33. }
  34. }
  35. </script>
  36. <style lang="less" scoped>
  37. /* 自定义整个滚动条 */
  38. ::-webkit-scrollbar {
  39. width: 10px; /* 设置滚动条的宽度 */
  40. }
  41. /* 自定义滚动条轨道 */
  42. ::-webkit-scrollbar-track {
  43. background: #f1f1f1; /* 设置轨道的背景颜色 */
  44. }
  45. /* 自定义滚动条的滑块(thumb) */
  46. ::-webkit-scrollbar-thumb {
  47. background: #888; /* 设置滑块的背景颜色 */
  48. }
  49. /* 当滑块悬停或活动时自定义滚动条的滑块 */
  50. ::-webkit-scrollbar-thumb:hover {
  51. background: #555; /* 设置滑块在悬停状态下的背景颜色 */
  52. }
  53. ::v-deep {
  54. .w-e-menu {
  55. z-index: 1 !important;
  56. }
  57. .w-e-text-container {
  58. z-index: 1 !important;
  59. }
  60. .w-e-toolbar {
  61. overflow: scroll !important;
  62. }
  63. }
  64. #app {
  65. width: 100% !important;
  66. }
  67. </style>