didi / mand-mobile

💰 A mobile UI toolkit, based on Vue.js 2, designed for financial scenarios.
https://didi.github.io/mand-mobile
Apache License 2.0
3.46k stars 772 forks source link

[feature-request] Dialog.succeed和Dialog.failed模态框支持单按钮形式 #672

Closed xjchengo closed 4 years ago

xjchengo commented 4 years ago

What problem does this feature solve?

某些场景下的成功和失败弹框只有单一操作,不需要两个按钮

What does the proposed API look like?

可以通过设置按钮文字为空取消掉一个按钮

Dialog.succeed({
  title: '成功',
  content: '恭喜您成功完成操作',
  cancelText: null,
  confirmText: '确定',
  onConfirm: () => console.log('[Dialog.succeed] confirm clicked'),
}
xxyan0205 commented 4 years ago

这种单按钮场景可以直接使用alert

Dialog.alert({
  icon: 'success-color', // 增加一个icon设置
  title: '成功',
  content: '恭喜您成功完成操作',
  cancelText: null,
  confirmText: '确定',
  onConfirm: () => console.log('[Dialog.succeed] confirm clicked'),
}
xjchengo commented 4 years ago

谢谢,可以解决这个问题