PageMode.vue 815 B

12345678910111213141516171819202122232425
  1. <template>
  2. <Button :class="{ active: isOpen }" @click="changePageViewStatus" :title="$t('header.viewSetting')">
  3. <Pageset />
  4. </Button>
  5. </template>
  6. <script setup>
  7. import { computed } from 'vue'
  8. import { useViewerStore } from '@/stores/modules/viewer'
  9. const useViewer = useViewerStore()
  10. const isOpen = computed(() => useViewer.isElementOpen('pageModePanel'))
  11. const toolMode = computed(() => useViewer.getToolMode)
  12. const changePageViewStatus = () => {
  13. if (isOpen.value) {
  14. useViewer.closeElement('pageModePanel')
  15. toolMode.value === 'separation' && useViewer.openElement('colorSeparationPanel')
  16. } else {
  17. useViewer.openElement('pageModePanel')
  18. useViewer.closeElement('contentEditorPanel')
  19. toolMode.value === 'separation' && useViewer.closeElement('colorSeparationPanel')
  20. }
  21. }
  22. </script>