mirror of
https://github.com/KevinMidboe/vue-js-modal.git
synced 2025-10-29 18:00:20 +00:00
Update README.md
This commit is contained in:
13
README.md
13
README.md
@@ -42,7 +42,7 @@ Vue.use(VModal, { componentName: "foo-modal" })
|
|||||||
|
|
||||||
Create modal:
|
Create modal:
|
||||||
|
|
||||||
```html
|
```vue
|
||||||
<modal name="hello-world">
|
<modal name="hello-world">
|
||||||
hello, world!
|
hello, world!
|
||||||
</modal>
|
</modal>
|
||||||
@@ -63,7 +63,7 @@ methods: {
|
|||||||
|
|
||||||
You can easily send data into the modal:
|
You can easily send data into the modal:
|
||||||
|
|
||||||
```vue
|
```javascript
|
||||||
this.$modal.show('hello-world', { foo: 'bar' })
|
this.$modal.show('hello-world', { foo: 'bar' })
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -71,7 +71,8 @@ And receive it in `beforeOpen` event handler:
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<modal name="hello-world" @before-open="beforeOpen"/>
|
<modal name="hello-world" @before-open="beforeOpen"/>
|
||||||
...
|
```
|
||||||
|
```javascript
|
||||||
methods: {
|
methods: {
|
||||||
beforeOpen (event) {
|
beforeOpen (event) {
|
||||||
console.log(event.params.foo);
|
console.log(event.params.foo);
|
||||||
@@ -87,19 +88,19 @@ It is a simplified version of the modal, which has most parameters set by defaul
|
|||||||
|
|
||||||
To start using `<Dialog/>` you will have set a configuration:
|
To start using `<Dialog/>` you will have set a configuration:
|
||||||
|
|
||||||
```
|
```javascript
|
||||||
Vue.use(VModal, { dialog: true })
|
Vue.use(VModal, { dialog: true })
|
||||||
```
|
```
|
||||||
|
|
||||||
And include it in your project:
|
And include it in your project:
|
||||||
|
|
||||||
```
|
```vue
|
||||||
<dialog/>
|
<dialog/>
|
||||||
```
|
```
|
||||||
|
|
||||||
Call it (all params except of “text” are optional):
|
Call it (all params except of “text” are optional):
|
||||||
|
|
||||||
```
|
```javascript
|
||||||
this.$modal.show('dialog', {
|
this.$modal.show('dialog', {
|
||||||
title: 'Alert!',
|
title: 'Alert!',
|
||||||
text: 'You are too awesome',
|
text: 'You are too awesome',
|
||||||
|
|||||||
Reference in New Issue
Block a user