Fullscreen.vue 610 B

123456789101112131415161718192021222324
  1. <script setup lang="ts">
  2. import VividMenuItem from "../../components/VividMenuItem.vue";
  3. import { useEditorInstance } from "../utils/common";
  4. const editorInstance = useEditorInstance();
  5. function toggleFullscreen() {
  6. editorInstance.value.storage.fullscreen.value = !editorInstance.value.storage.fullscreen.value;
  7. }
  8. </script>
  9. <template>
  10. <div v-if="editorInstance">
  11. <slot>
  12. <vivid-menu-item
  13. :icon="editorInstance.storage.fullscreen.value ? 'fullscreen-exit-line' : 'fullscreen-line'"
  14. title="全屏"
  15. :action="toggleFullscreen"
  16. />
  17. </slot>
  18. </div>
  19. </template>
  20. <style scoped></style>