fix(full-screen): dom fullscreen status text (#3130)

* chore: Fix ts type error

* chore: fix type:check error

* fix(full-screen): dom fullscreen status text
This commit is contained in:
bowen 2023-10-11 10:47:24 +08:00 committed by GitHub
parent 5a388be15e
commit e161c1449a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,9 @@
ref="domRef" ref="domRef"
class="flex items-center justify-center w-1/2 h-64 mx-auto mt-10 bg-white rounded-md" class="flex items-center justify-center w-1/2 h-64 mx-auto mt-10 bg-white rounded-md"
> >
<a-button type="primary" @click="toggleDom" class="mr-2"> Exit Dom Full Screen </a-button> <a-button type="primary" @click="toggleDom" class="mr-2">
{{ isDomFullscreen ? 'Exit Dom Full Screen' : 'Enter Dom Full Screen' }}
</a-button>
</div> </div>
</PageWrapper> </PageWrapper>
</template> </template>
@ -37,12 +39,13 @@
const domRef = ref<Nullable<HTMLElement>>(null); const domRef = ref<Nullable<HTMLElement>>(null);
const { enter, toggle, exit, isFullscreen } = useFullscreen(); const { enter, toggle, exit, isFullscreen } = useFullscreen();
const { toggle: toggleDom } = useFullscreen(domRef); const { toggle: toggleDom, isFullscreen: isDomFullscreen } = useFullscreen(domRef);
return { return {
enter, enter,
toggleDom, toggleDom,
toggle, toggle,
isFullscreen, isFullscreen,
isDomFullscreen,
exit, exit,
domRef, domRef,
}; };