Demo:优化主题设置弹窗

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

View File

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