npm.io
0.0.37 • Published 6 years ago

vuetify-gen

Licence
MIT
Version
0.0.37
Deps
2
Size
198 kB
Vulns
0
Weekly
0
Stars
5

install

npm install vuetify-gen --save

create plugins/vuetify-gen.js

import Vue from 'vue'
// your plugins/vuetify
import vuetify from './vuetify'
import * as components from 'vuetify-gen/lib/components'
import vuetifyGen from 'vuetify-gen'

Vue.use(vuetifyGen, {
  vuetify,
  components
})

use

online demo

toast
this.$toast('message')
// timeout
this.$toast('message', 2000)
// persistent
this.$toast('message', 2000, true)
notify
this.$notify('message')
// color
this.$notify('message', 'success')
// timeout
this.$notify('message', 'success', 2000)
confirm
this.$confirm('title').then(() => { 
  console.log('ok') 
}).catch(() => {
  console.log('cancel') 
})
// confirm persistent
this.$confirm('title', true)
form
this.$form(
  'form title', [ 
   {
     is: 'v-text-field',
     name: 'username',
     props: {
       label: 'username label'
     }
   }
 ],
 // persistent
 true
).then(({ username }) => { 
  console.log('submit', username) 
}).catch(() => {
  console.log('cancel') 
})
dateTimePicker
this.$dateTimePicker().then(date => { 
  console.log('submit', date) 
}).catch(() => {
  console.log('cancel') 
})
// range
this.$dateTimePicker(true)
// persistent
this.$dateTimePicker(true, true)