view-design / ViewUI

A high quality UI Toolkit built on Vue.js 2.0
https://www.iviewui.com/
Other
2.65k stars 797 forks source link

[Feature Request]this.$Modal.confirm(config) 这个配置可以开放按钮的类型配置?现在默认是primary #1008

Open black0723 opened 2 years ago

black0723 commented 2 years ago

What problem does this feature solve?

需求:在删除的时候要求 按钮 为 error ,在发出警告时按钮为 warning 。而现在不能配置,因为一个按钮颜色,不得不重新写一套confirm组件。

What does the proposed API look like?

this.$Modal.confirm({
    title: '',
    content: '',

    okText: '删除',
    okType: 'error', // 需要新增的 配置项
    onOk: () => {
    },

    cancelText:'取消',
    cancelType:'info', // 需要新增的 配置项
    onCancel:() => {
    }
})
zhengoo commented 1 year ago

cancelButtonProps: { type: 'primary' }