Skip to content

Commit 4a7554b

Browse files
author
redmi
committed
iframe
1 parent 09d3703 commit 4a7554b

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed
Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
11
<template>
2-
<input type="file" @change="e => handleViewClick(e.target.files[0])">
2+
<div class="box">
3+
<input class="form-control" type="file" @change="e => handleViewClick(e.target.files[0])">
4+
<iframe class="frame" :src></iframe>
5+
</div>
36
</template>
47

58
<script setup>
9+
const src = ref();
610
function handleViewClick(file)
711
{
8-
location.href = `/pdfviewer/web/viewer.html?file=${URL.createObjectURL(file)}`;
12+
src.value = `/pdfviewer/web/viewer.html?file=${URL.createObjectURL(file)}`;
913
}
1014
</script>
15+
16+
<style scoped>
17+
.box {
18+
position: fixed;
19+
top: 0;
20+
right: 0;
21+
bottom: 0;
22+
left: 0;
23+
display: flex;
24+
flex-direction: column;
25+
}
26+
.frame {
27+
flex: auto;
28+
}
29+
</style>

0 commit comments

Comments
 (0)