Merge branch 'main' of https://github.com/zclzone/vue-naive-admin
This commit is contained in:
commit
7478f193f9
@ -8,15 +8,15 @@ const NDialog = useDialog()
|
|||||||
|
|
||||||
class Dialog {
|
class Dialog {
|
||||||
success(title, option) {
|
success(title, option) {
|
||||||
this.showDialog('success', { title, ...option })
|
return this.showDialog('success', { title, ...option })
|
||||||
}
|
}
|
||||||
|
|
||||||
warning(title, option) {
|
warning(title, option) {
|
||||||
this.showDialog('warning', { title, ...option })
|
return this.showDialog('warning', { title, ...option })
|
||||||
}
|
}
|
||||||
|
|
||||||
error(title, option) {
|
error(title, option) {
|
||||||
this.showDialog('error', { title, ...option })
|
return this.showDialog('error', { title, ...option })
|
||||||
}
|
}
|
||||||
|
|
||||||
showDialog(type = 'success', option) {
|
showDialog(type = 'success', option) {
|
||||||
@ -24,7 +24,7 @@ class Dialog {
|
|||||||
// ! 没有title的情况
|
// ! 没有title的情况
|
||||||
option.showIcon = false
|
option.showIcon = false
|
||||||
}
|
}
|
||||||
NDialog[type]({
|
return NDialog[type]({
|
||||||
positiveText: 'OK',
|
positiveText: 'OK',
|
||||||
closable: false,
|
closable: false,
|
||||||
...option,
|
...option,
|
||||||
@ -32,7 +32,7 @@ class Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
confirm(option = {}) {
|
confirm(option = {}) {
|
||||||
this.showDialog(option.type || 'error', {
|
return this.showDialog(option.type || 'error', {
|
||||||
positiveText: '确定',
|
positiveText: '确定',
|
||||||
negativeText: '取消',
|
negativeText: '取消',
|
||||||
onPositiveClick: option.confirm,
|
onPositiveClick: option.confirm,
|
||||||
|
Loading…
Reference in New Issue
Block a user