mirror of
https://github.com/ZiuChen/ZiuChen.github.io.git
synced 2025-12-20 01:35:38 +08:00
feat: 新增 Demo 站点
This commit is contained in:
36
docs/demos/promiseify-post-message/Index.vue
Normal file
36
docs/demos/promiseify-post-message/Index.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div class="home">
|
||||
<h2>Home</h2>
|
||||
<iframe ref="iframeRef" src="/demos/promiseify-post-message/inner" frameborder="0" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { registerBase } from './base'
|
||||
|
||||
const iframeRef = ref<HTMLIFrameElement | null>(null)
|
||||
|
||||
onMounted(() => {
|
||||
if (iframeRef.value && iframeRef.value.contentWindow) {
|
||||
registerBase(iframeRef.value.contentWindow)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 隐藏掉窄屏时 fixd 在顶部的 Return to top */
|
||||
:global(.VPLocalNav) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.home {
|
||||
padding: 25px;
|
||||
}
|
||||
|
||||
iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user