mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-23 03:53:34 +08:00
Share workspace packages between Ray Admin and the interactive docs. BREAKING CHANGE: v6 is a new major line. v5 stays on legacy/v5.
29 lines
673 B
Vue
29 lines
673 B
Vue
<template>
|
|
<div ref="preview" class="ray-demo fullscreen-demo">
|
|
<NButton @click="toggleFullscreen">
|
|
{{
|
|
isFullscreen ? '退出全屏 / Exit full screen' : '元素全屏 / Full screen'
|
|
}}
|
|
</NButton>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { useElementFullscreen } from '@ray-template/composables/useElementFullscreen'
|
|
import { NButton } from 'naive-ui'
|
|
import { useTemplateRef } from 'vue'
|
|
|
|
const { isFullscreen, toggleFullscreen } = useElementFullscreen(
|
|
useTemplateRef('preview'),
|
|
)
|
|
</script>
|
|
|
|
<style scoped>
|
|
.fullscreen-demo {
|
|
display: grid;
|
|
place-items: center;
|
|
margin: 0;
|
|
background: var(--vp-c-bg-soft);
|
|
}
|
|
</style>
|