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

删除冗余代码

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