index.js 865 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import Vue from 'vue'
  2. import UITips from './Tips.vue'
  3. import UIAlert from './Alert.vue'
  4. import UIConfirm from './Confirm.vue'
  5. export const Tips = Vue.extend(UITips)
  6. export const Alert = Vue.extend(UIAlert)
  7. export const Confirm = Vue.extend(UIConfirm)
  8. export function $tips(data={}) {
  9. let instance = new Tips({
  10. data
  11. }).$mount()
  12. document.body.appendChild(instance.$el)
  13. Vue.nextTick(() => {
  14. instance.show = true
  15. })
  16. }
  17. export function $alert(data={}) {
  18. let instance = new Alert({
  19. data
  20. }).$mount()
  21. document.body.appendChild(instance.$el)
  22. Vue.nextTick(() => {
  23. instance.show = true
  24. })
  25. }
  26. export function $confirm(data={}) {
  27. let instance = new Confirm({
  28. data
  29. }).$mount()
  30. document.body.appendChild(instance.$el)
  31. Vue.nextTick(() => {
  32. instance.show = true
  33. })
  34. }