Skip to content

Commit 0976965

Browse files
committed
docs: revise usage
1 parent 23fbd7e commit 0976965

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,31 @@ pnpm install @watermarkify/vue-watermark
2929

3030
## Usage
3131

32-
Retrieved from [playground](./playground/)
32+
The following code snippet is retrieved from [playground](./playground/). You may also try the interactive playground [here](https://watermarkify.github.io/vue-watermark/).
3333

3434
```vue
3535
<script setup lang="ts">
36-
import { ref } from 'vue'
3736
// step 1: import Watermark from @watermarkify/vue-watermark
3837
import { Watermark } from '@watermarkify/vue-watermark'
3938
4039
// step 2: define watermark options
40+
// see https://github.com/watermarkify/vue-watermark#options
4141
const watermarkOptions = ref({
42-
content: 'watermark'
42+
content: 'watermark',
43+
gap: [20, 20],
44+
offset: [10, 10],
45+
zIndex: 5,
46+
rotate: -20,
4347
})
4448
</script>
49+
```
50+
51+
Pass `watermarkOptions` to `options` and define your slot.
4552

46-
<template>
47-
<div>
48-
<h1>Watermark Example</h1>
49-
<!-- step 3: apply watermark on the target slot -->
50-
<Watermark :options="watermarkOptions">
51-
<div class="content">This is the content of the slot.</div>
52-
</Watermark>
53-
</div>
54-
</template>
53+
```vue
54+
<Watermark :options="watermarkOptions">
55+
<div>This is the content of the slot.</div>
56+
</Watermark>
5557
```
5658

5759
## Options

0 commit comments

Comments
 (0)