Skip to content

Latest commit

 

History

History
76 lines (47 loc) · 2.22 KB

README_zh.md

File metadata and controls

76 lines (47 loc) · 2.22 KB

Github releaseLicense

English

是什么

一个漂亮的基于vue3的pdf查看组件。

使用

安装

npm install just-pdf-viewer

导入

import { createApp } from 'vue'
import JustPdfViewer from 'just-pdf-viewer';
import App from './App.vue';
import 'just-pdf-viewer/es/style.css'

const app = createApp(App);
app.use(JustPdfViewer);
app.mount('#app');

vue中使用

<script setup lang="ts">
import {ref} from "vue";
const rotatable = ref<boolean>(true)
const scalable = ref<boolean>(true)
const lazyLoad = ref<boolean>(false)
</script>

<template>
	<just-pdf-viewer src="/test.pdf" width="100vw" height="100vh" :rotatable="rotatable"  :scalable="scalable"  :lazy-load="lazyLoad"/>
</template>

<style scoped>

</style>

API

<just-pdf-viewer> Props

属性名 描述 类型 默认值 版本
width 指定查看器的宽度 string -- 1.0.1
height 指定查看器的高度 string -- 1.0.1
src 指定查看器的pdf资源来源 string | URL | TypedArray | ArrayBuffer | DocumentInitParameters -- 1.0.1
rotatable 指定是否可以旋转 boolean true 1.0.1
scalable 指定是否可以缩放 boolean true 1.0.1
lazy-load 指定是否全部渲染 boolean true 1.0.1

DocumentInitParameters@见#getDocument

在线例子

https://just.pdf.viewer.sdefaa.com:8849