Demo:优化主题设置弹窗

This commit is contained in:
街角小林
2024-01-31 17:50:28 +08:00
parent 679330663a
commit af622793d8

View File

@@ -149,15 +149,17 @@ export default {
this.$confirm(this.$t('theme.coverTip'), this.$t('theme.tip'), {
confirmButtonText: this.$t('theme.cover'),
cancelButtonText: this.$t('theme.reserve'),
type: 'warning'
type: 'warning',
distinguishCancelAndClose: true,
callback: action => {
if (action === 'confirm') {
this.mindMap.setThemeConfig({}, true)
this.changeTheme(theme, {})
} else if (action === 'cancel') {
this.changeTheme(theme, customThemeConfig)
}
}
})
.then(() => {
this.mindMap.setThemeConfig({}, true)
this.changeTheme(theme, {})
})
.catch(() => {
this.changeTheme(theme, customThemeConfig)
})
} else {
this.changeTheme(theme, customThemeConfig)
}