Skip to content

Commit 3c1ef11

Browse files
author
redmi
committed
pdf viewer
1 parent 1a3d11d commit 3c1ef11

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

.apps/tools/src/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const router = createRouter({
1010
{ path: '/calc', component: () => import('./views/Calc.vue') },
1111
{ path: '/file-byte', component: () => import('./views/FileByte.vue') },
1212
{ path: '/nes-color', component: () => import('./views/NesColor.vue') },
13+
{ path: '/pdf-viewer', component: () => import('./views/PdfViewer.vue') },
1314
],
1415
});
1516

.apps/tools/src/views/Home.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
<li><RouterLink to="/calc">计算器</RouterLink></li>
55
<li><RouterLink to="/file-byte">文件字节 File Byte</RouterLink></li>
66
<li><RouterLink to="/nes-color">Nes Color</RouterLink></li>
7+
<li><RouterLink to="/pdf-viewer">PDF Viewer</RouterLink></li>
78
</ol>
89
</template>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<template>
2+
<input type="file" @change="e => handleViewClick(e.target.files[0])">
3+
</template>
4+
5+
<script setup>
6+
function handleViewClick(file)
7+
{
8+
location.href = `/pdfviewer/web/viewer.html?file=${URL.createObjectURL(file)}`;
9+
}
10+
</script>

0 commit comments

Comments
 (0)