mirror of
https://github.com/KevinMidboe/vue-js-modal.git
synced 2025-12-08 20:48:46 +00:00
Updated README with "top-right" slot example (#16)
This commit is contained in:
22
README.md
22
README.md
@@ -105,6 +105,28 @@ export default {
|
|||||||
This example, initializes `time` variable every time the modal is being opened.
|
This example, initializes `time` variable every time the modal is being opened.
|
||||||
And then forbits closing it for the next 5000 ms
|
And then forbits closing it for the next 5000 ms
|
||||||
|
|
||||||
|
### Other
|
||||||
|
|
||||||
|
#### Close button
|
||||||
|
If you want to have a Close (x) button in the top-right corner, you can use "top-right" slot for it. There is deliberately no predefined Close button style - you will have to implement/use your own button.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```vue
|
||||||
|
<template>
|
||||||
|
<modal name="foo">
|
||||||
|
|
||||||
|
<div slot="top-right">
|
||||||
|
<button @click="$modal.hide('foo')">
|
||||||
|
x
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
Hello, world!
|
||||||
|
|
||||||
|
</modal>
|
||||||
|
</template>
|
||||||
|
```
|
||||||
|
|
||||||
### Developers
|
### Developers
|
||||||
|
|
||||||
To run an example:
|
To run an example:
|
||||||
|
|||||||
Reference in New Issue
Block a user