App.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <a-locale-provider :locale="locale">
  3. <div id="app">
  4. <router-view />
  5. </div>
  6. </a-locale-provider>
  7. </template>
  8. <script>
  9. import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
  10. import enquireScreen from '@/utils/device'
  11. export default {
  12. data() {
  13. return {
  14. locale: zhCN,
  15. }
  16. },
  17. created() {
  18. let that = this
  19. enquireScreen(deviceType => {
  20. // tablet
  21. if (deviceType === 0) {
  22. that.$store.commit('TOGGLE_DEVICE', 'mobile')
  23. that.$store.dispatch('setSidebar', false)
  24. }
  25. // mobile
  26. else if (deviceType === 1) {
  27. that.$store.commit('TOGGLE_DEVICE', 'mobile')
  28. that.$store.dispatch('setSidebar', false)
  29. } else {
  30. that.$store.commit('TOGGLE_DEVICE', 'desktop')
  31. that.$store.dispatch('setSidebar', true)
  32. }
  33. })
  34. }
  35. }
  36. </script>
  37. <style>
  38. #app {
  39. height: 100%;
  40. }
  41. body {
  42. -webkit-user-select: text !important;
  43. }
  44. * {
  45. -webkit-user-select: text !important;
  46. -moz-user-select: text !important;
  47. -ms-user-select: text !important;
  48. user-select: text !important;
  49. }
  50. .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab {
  51. height: 39px !important;
  52. }
  53. .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active {
  54. height: 39px !important;
  55. border-bottom:1px solid #1890ff !important;
  56. }
  57. .layout .header {
  58. background-color:#0B2040 !important;
  59. background:#0B2040 !important;
  60. }
  61. </style>