fix: 修复点击代码生成菜单后,再点击其他菜单,对应页面空白的问题

此问题是在新增生成预览功能时引起的

Closes #27
This commit is contained in:
Charles7c 2023-12-26 19:31:56 +08:00
parent 99997c160e
commit b89f281a93

View File

@ -271,48 +271,47 @@
</a-card> </a-card>
</a-drawer> </a-drawer>
</a-card> </a-card>
</div> <!-- 生成预览区域 -->
<a-modal
<!-- 生成预览区域 --> :body-style="{
<a-modal
:body-style="{
paddingTop: 0, paddingTop: 0,
}" }"
title="生成预览" title="生成预览"
:visible="previewVisible" :visible="previewVisible"
width="70%" width="70%"
:footer="false" :footer="false"
unmount-on-close unmount-on-close
render-to-body render-to-body
@cancel="handlePreviewCancel" @cancel="handlePreviewCancel"
> >
<div> <div>
<a-scrollbar style="height: 700px; overflow: auto"> <a-scrollbar style="height: 700px; overflow: auto">
<a-link <a-link
style="position: absolute; right: 20px; top: 50px; z-index: 999" style="position: absolute; right: 20px; top: 50px; z-index: 999"
@click="handleCopy" @click="handleCopy"
>
<template #icon>
<icon-copy size="large" />
</template>
复制
</a-link>
<a-tabs size="large" @tab-click="handleTabClick">
<a-tab-pane
v-for="item in generatePreviewList"
:key="item.fileName"
:title="item.fileName"
> >
<codemirror <template #icon>
v-model="item.content" <icon-copy size="large" />
:autofocus="true" </template>
:extensions="extensions" 复制
/> </a-link>
</a-tab-pane> <a-tabs size="large" @tab-click="handleTabClick">
</a-tabs> <a-tab-pane
</a-scrollbar> v-for="item in generatePreviewList"
</div> :key="item.fileName"
</a-modal> :title="item.fileName"
>
<codemirror
v-model="item.content"
:autofocus="true"
:extensions="extensions"
/>
</a-tab-pane>
</a-tabs>
</a-scrollbar>
</div>
</a-modal>
</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>