You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

44 lines
964 B

  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 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. }
  30. else {
  31. that.$store.commit('TOGGLE_DEVICE', 'desktop')
  32. that.$store.dispatch('setSidebar', true)
  33. }
  34. })
  35. }
  36. }
  37. </script>
  38. <style>
  39. #app {
  40. height: 100%;
  41. }
  42. </style>