# ja-pdf-view

## 介绍
> 基于pdf.js的pdf查看预览组件。


## install
```
npm i ja-pdf-view --save
```
## 例子
```
<template>
  <div>
    <pdfView
      :pdfUrl = "pdfUrl"
      mode = "view"
    ></pdfView>
  </div>
</template>

<script>
import pdfView from 'ja-pdf-view'
export default {
  name: 'pdfView',
  components: {
    pdfView
  },
  data() {
    return {
      pdfUrl: null
    };
  },
}
</script>
```

## 参数说明
| 参数   | 类型   | 默认  | 描述        |
| -------| ------ |  ------- | ---------|
| mode| String | view| view: 普通查看模式， full: 全屏预览模式|

## 回调说明
| 参数   | 类型    | 描述        |
| -------| ------ | ---------|
| @load| Function | pdf加载完成回调，返回{totalNum: pdf总页数}|
| @changePage| Function | pdf切换预览页回调，返回{num: 当前页的下标}|

## 插槽说明
~~~
  <div slot="full">
    全屏模式显示的
  </div>
  <div slot="view">
    普通模式显示的
  </div>
  <div slot="loadding">
    pdf加载中显示的
  </div>
~~~