index.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div class="vab-right-tools">
  3. <vab-search v-show="!isHorizontal" class="hidden-xs-only" />
  4. <vab-dark v-show="theme.showDark" :style="!isHorizontal ? '' : { marginLeft: 'var(--el-margin)' }" />
  5. <vab-color-picker v-show="theme.showColorPicker" />
  6. <vab-theme v-show="theme.showTheme && routeName !== 'SeparateLayout'" />
  7. <vab-error-log class="hidden-xs-only" />
  8. <vab-font-size v-show="theme.showFontSize" />
  9. <vab-lock v-show="theme.showLock" />
  10. <vab-notice v-show="theme.showNotice" />
  11. <vab-language v-show="theme.showLanguage" />
  12. <vab-fullscreen v-show="theme.showFullScreen" />
  13. <vab-refresh v-show="theme.showRefresh" />
  14. <vab-avatar />
  15. </div>
  16. </template>
  17. <script lang="ts" setup>
  18. import { useSettingsStore } from '/@/store/modules/settings'
  19. defineOptions({
  20. name: 'VabRightTools',
  21. })
  22. defineProps({
  23. isHorizontal: {
  24. type: Boolean,
  25. default: false,
  26. },
  27. })
  28. const route = useRoute()
  29. const settingsStore = useSettingsStore()
  30. const { theme } = storeToRefs(settingsStore)
  31. const routeName = ref<any>(route.name)
  32. watch(
  33. route,
  34. () => {
  35. routeName.value = route.name
  36. },
  37. { immediate: true }
  38. )
  39. </script>
  40. <style lang="scss" scoped>
  41. .vab-right-tools {
  42. display: flex;
  43. align-items: center;
  44. justify-content: flex-end;
  45. }
  46. </style>