Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pic-reader
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
pic-reader
Commits
9be9c2fa
提交
9be9c2fa
authored
4月 24, 2025
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
删除冗余代码
上级
30e49f4e
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
13 行增加
和
30 行删除
+13
-30
components.d.ts
src/components.d.ts
+0
-1
BookReader.vue
src/components/BookReader.vue
+12
-21
vite.config.js
vite.config.js
+1
-8
没有找到文件。
src/components.d.ts
浏览文件 @
9be9c2fa
...
@@ -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'
]
...
...
src/components/BookReader.vue
浏览文件 @
9be9c2fa
...
@@ -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
:
'
doub
le'
,
display
:
'
sing
le'
,
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
{
...
...
vite.config.js
浏览文件 @
9be9c2fa
/*
* @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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论