Skip to content

Commit 7ee4135

Browse files
committedDec 7, 2018
v1.0.1
1 parent 2be5452 commit 7ee4135

File tree

4 files changed

+85
-10
lines changed

4 files changed

+85
-10
lines changed
 

‎README.md

+75-8
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ This module will help you to work with modal dialogs in your project
2121
</a>
2222
</p>
2323

24-
## Documentation
24+
## Vuedl module documentation
2525
[See docs here](https://github.com/yariksav/vuedl#readme)
2626

2727
## Demo
28-
[See demo in CodeSandbox](https://k2910xo07r.codesandbox.io/)
28+
[See demo in CodeSandbox](https://ppx57r3nnj.codesandbox.io/)
2929

3030
## Setup
3131

@@ -46,6 +46,30 @@ Vue.use(VuetifyDialog, {
4646
+ `context` - the context of your application, such as store, axios, router etc.
4747
+ `property` - the property, which will integrate to Vue. Default is `$dialog`
4848

49+
## ♻️ Usage with Nuxt.js
50+
51+
Add `vuetify-dialog/nuxt` to modules section of `nuxt.config.js`
52+
53+
Module automatically add to dialog nuxt context data, such as router, route, i18n, $axios, etc
54+
55+
```js
56+
{
57+
modules: [
58+
// Simple usage
59+
'vuetify-dialog/nuxt'
60+
61+
// Optionally passing options in module configuration
62+
['vuetify-dialog/nuxt', { property: '$dialog' }]
63+
],
64+
65+
// Optionally passing options in module top level configuration
66+
vuetifyDialog: {
67+
property: '$dialog'
68+
}
69+
}
70+
```
71+
72+
4973
### Simple confirm dialog
5074
```js
5175
const res = await this.$dialog.confirm({
@@ -78,16 +102,59 @@ let res = await this.$dialog.prompt({
78102
})
79103
```
80104

81-
### Messages
105+
106+
### Notifications
107+
The notification component is used to convey important information to the user.
108+
Notification support positioning, removal delay and callbacks. It comes in 4 variations, **success**, **info**, **warning** and **error**. These have default icons assigned which can be changed and represent different actions
109+
110+
Notification uses [v-alert](https://vuetifyjs.com/en/components/alerts) component
111+
112+
Props:
113+
* **text** - _the text fo your message_
114+
- type: String
115+
* options:
116+
- type: Object
117+
- properties:
118+
- position: one of _top-left_, _top-right_, _bottom-left_, _bootom-right_
119+
- timeoot: timer to hide message. Default 5000. If set to 0 - message will not closes automatically
120+
- actions
82121
```js
83-
this.$dialog.message.warning('Warning message')
84-
this.$dialog.message.error('Error message')
85-
this.$dialog.message.info('Info message')
86-
this.$dialog.message.success('Success message')
122+
this.$dialog.notify.info('Test notification', {
123+
position: 'top-right',
124+
timeout: 5000
125+
})
87126
```
88127

128+
### Toasts
129+
The toast component is used to display a quick message to a user. Toasts support positioning, removal delay and callbacks. It comes in 4 variations, **success**, **info**, **warning** and **error**. These have default icons assigned which can be changed and represent different actions
130+
131+
Toast uses [v-snackbar](https://vuetifyjs.com/en/components/snackbars) component
132+
133+
Props:
134+
* **text** - _the text fo your message_
135+
- type: String
136+
* options:
137+
- type: Object
138+
- properties:
139+
- position: one of _top-left_, _top-right_, _bottom-left_, _bootom-right_
140+
- timeoot: timer to hide message. Default 5000. If set to 0 - message will not closes automatically
141+
- actions: - see below
142+
``` javascript
143+
this.$dialog.message.{{type}}('{{text}}, {
144+
position: '{{position}}'
145+
})
146+
```
89147
### Actions
90-
To all this simple dialogs you can config your actions, just put to options
148+
To all dialogs you can put your own buttons
149+
Props:
150+
* **key** - _the text fo your message_
151+
- type: String
152+
* options:
153+
- type: Object
154+
- properties:
155+
- position: one of _top-left_, _top-right_, _bottom-left_, _bootom-right_
156+
- timeoot: timer to hide message. Default 5000. If set to 0 - message will not closes automatically
157+
- actions: - see below
91158
```js
92159
{
93160
...

‎nuxt/plugin.template.js

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export default (obj, inject) => {
1414
}))
1515
context.route = obj.route
1616

17-
console.log(context, 'context')
1817
Vue.use(VuetifyDialog, { context, ...pluginOptions })
1918
const instance = Vue.prototype[property]
2019
if (instance) {

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuetify-dialog",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Dialog helper for vuetify.js",
55
"scripts": {
66
"build2": "npm run build && cp -r dist/ ../../cmpact/billing-front/node_modules/vuetify-dialog/dist/ && cp -r src/ ../../cmpact/billing-front/node_modules/vuetify-dialog/src/",

‎webpack.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const path = require('path')
2+
3+
module.exports = {
4+
entry: './src/index.js',
5+
output: {
6+
path: path.resolve(__dirname, 'dist'),
7+
filename: 'bundle.js'
8+
}
9+
}

0 commit comments

Comments
 (0)
Please sign in to comment.