Skip to content

Commit

Permalink
Update docs for 1.9.7 package version
Browse files Browse the repository at this point in the history
  • Loading branch information
TaTo30 committed May 13, 2024
1 parent ee686d7 commit 61b5651
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 21 deletions.
24 changes: 23 additions & 1 deletion docs/guide/composables.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
outline: [2,3]
---

# Composables

## usePDF
Expand All @@ -18,11 +22,29 @@ const { pdf, pages, info } = usePDF('sample.pdf')
</template>
```

### Reactivity

`usePDF` is also reactive if you use a `ref<src>` instead of a plain `src`, when the value of `ref` changes the returned values also chage.

```vue
<script setup>
import { VuePDF, usePDF } from '@tato30/vue-pdf'
// Changing currentPdf value will change pdf, pages and info values
const currentPdf = ref('sample.pdf')
const { pdf, pages, info } = usePDF(currentPdf)
</script>
<template>
<VuePDF :pdf="pdf" />
</template>
```

### Parameters

#### src

Type: `string | URL | TypedArray | DocumentInitParameters` <br/>
Type: `string | URL | TypedArray | DocumentInitParameters | ref<string> | ref<URL> | ref<TypedArray> | ref<DocumentInitParameters>` <br/>
Required: `True`

This parameter is the same `src` of [pdf.js](https://github.com/mozilla/pdf.js/blob/38287d943532eee939ceffbe6861163f93805ca7/src/display/api.js#L145)
Expand Down
14 changes: 4 additions & 10 deletions docs/guide/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,16 @@ VuePDF is a **client-side** component for **Vue 3** that allows you to flexibly

## Installation

<CodeGroup>
<CodeGroupItem title="NPM">

```bash:no-line-numbers
::: code-group
```sh [npm]
npm i @tato30/vue-pdf
```

</CodeGroupItem>
<CodeGroupItem title="YARN">

```bash:no-line-numbers
```sh [npm]
yarn add @tato30/vue-pdf
```
:::

</CodeGroupItem>
</CodeGroup>


## Basic Usage
Expand Down
6 changes: 4 additions & 2 deletions docs/guide/props.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,16 @@ Enables text selection.

## highlight-text <badge type="tip" text="v1.9" vertical="middle" />

Type: `string` <br />
Type: `string | string[]` <br />
Required: `false` <br />
Default: `null`

Highlight on the page the searched text.
Highlight on the page the searched text or the searched array of text.

```vue
<VuePDF :pdf="pdf" text-layer hightlight-text="javascript" />
<VuePDF :pdf="pdf" text-layer :hightlight-text="['javascript', 'trace-based']" />
```

## highlight-options <badge type="tip" text="v1.9" vertical="middle" />
Expand Down
12 changes: 6 additions & 6 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-pdf-docs",
"version": "1.9.5",
"version": "1.9.7",
"description": "VuePDF Documentation",
"main": "index.js",
"repository": "https://github.com/TaTo30/VuePDF",
Expand All @@ -14,6 +14,6 @@
"vitepress": "^1.0.0-rc.34"
},
"dependencies": {
"@tato30/vue-pdf": "1.9.5"
"@tato30/vue-pdf": "^1.9.7"
}
}

0 comments on commit 61b5651

Please sign in to comment.