v-dialogs v2.1.3,简洁的指令式对话框插件

2019-10-28 10:51:28 +08:00
 Terry05

更新内容:

v-dialogs

一款基于 Vue2 的干净简洁的指令式对话框组件,它包含了 Modal、Alert、Mask 和 Toast 等功能形态

实例和文档

用法

// include and install in main.js
import Vue from 'vue'
import vDialog from 'v-dialogs'
Vue.use(vDialog)

// in everywhere
// Modal
import UserProfile from './UserProfile.vue'
this.$dlg.modal(UserProfile, {
  width: 400,
  height: 300,
  title: 'User Profile',
  params: {
    userId: 1,
    userName: 'Terry Zeng'
  },
  callback: data => {
    this.$dlg.alert(`Received message: ${data}`)
  }
})

// Alert
this.$dlg.alert('message', callback, options)

// Mask
const key = this.$dlg.mask('Data loading, please hold on a moment...')
// do some stuff
job().then(resp => {
  // close mark layer when job done
  this.$dlg.close(key)
})

// Toast
this.$dlg.taost('message', callback, options)

2430 次点击
所在节点    分享创造
2 条回复
deathscythe
2019-10-28 14:23:44 +08:00
不觉得放大窗口的按钮跟关闭按钮不水平对齐么?
Terry05
2019-10-28 15:28:23 +08:00
@deathscythe 最大化的图标通常都会在中轴位置偏上,可以观察一下 Windows 窗口最大化的图标

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/613580

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX