提交 9be9c2fa authored 作者: 龙菲's avatar 龙菲

删除冗余代码

上级 30e49f4e
......@@ -8,7 +8,6 @@ export {}
/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
BookRead: typeof import('./components/BookRead.vue')['default']
BookReader: typeof import('./components/BookReader.vue')['default']
FileUpload: typeof import('./components/FileUpload.vue')['default']
IconCommunity: typeof import('./components/icons/IconCommunity.vue')['default']
......
......@@ -17,20 +17,13 @@
<!-- 添加小图叠加层 -->
<div v-if="page.images && page.images.length > 0" class="small-images-overlay">
<div v-for="(smallImage, imgIndex) in page.images"
:key="imgIndex"
class="small-image-container"
:style="{
<div v-for="(smallImage, imgIndex) in page.images" :key="imgIndex" class="small-image-container" :style="{
left: `${smallImage.position.x1 * 100}%`,
top: `${smallImage.position.y1 * 100}%`,
width: `${(smallImage.position.x2 - smallImage.position.x1) * 100}%`,
height: `${(smallImage.position.y2 - smallImage.position.y1) * 100}%`
}"
@click="handleSmallImageClick(smallImage, page.page_num)">
<img :src="smallImage.url"
:alt="`小图 ${imgIndex + 1}`"
class="small-image" />
}" @click="handleSmallImageClick(smallImage, page.page_num)">
<img :src="smallImage.url" :alt="`小图 ${imgIndex + 1}`" class="small-image" />
</div>
</div>
</div>
......@@ -65,12 +58,8 @@
</div>
<!-- 替换为 vue-easy-lightbox 预览组件 -->
<vue-easy-lightbox
:visible="showViewer"
:imgs="previewImages"
:index="currentImageIndex"
@hide="showViewer = false"
/>
<vue-easy-lightbox :visible="showViewer" :imgs="previewImages" :index="currentImageIndex"
@hide="showViewer = false" />
</div>
</template>
......@@ -83,7 +72,7 @@ import VueEasyLightbox from 'vue-easy-lightbox'
const props = defineProps({
pages: {
type: Array,
default: ()=>[],
default: () => [],
required: true
}
})
......@@ -219,9 +208,9 @@ const initBook = async () => {
// 初始化 turn.js
$magazine.turn({
width: pageWidth * 2,
width: pageWidth * 1,
height: pageHeight,
display: 'double',
display: 'single',
acceleration: false,
gradients: true,
elevation: 50,
......@@ -791,7 +780,8 @@ const handleSmallImageClick = (smallImage, pageNum) => {
left: 0;
width: 100%;
height: 100%;
pointer-events: none; /* 允许点击穿透到下层 */
pointer-events: none;
/* 允许点击穿透到下层 */
}
.small-image-container {
......@@ -811,7 +801,8 @@ const handleSmallImageClick = (smallImage, pageNum) => {
width: 100%;
height: 100%;
object-fit: contain;
pointer-events: none; /* 防止图片本身接收点击事件 */
pointer-events: none;
/* 防止图片本身接收点击事件 */
}
.debug-info {
......
/*
* @Author: 龙菲 1373694886@qq.com
* @Date: 2025-04-22 22:24:25
* @LastEditors: 龙菲 1373694886@qq.com
* @LastEditTime: 2025-04-23 22:52:11
* @FilePath: \pic-reader\vite.config.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论