Demo:优化主题设置弹窗
This commit is contained in:
parent
679330663a
commit
af622793d8
@ -149,15 +149,17 @@ 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,
|
||||||
|
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 {
|
} else {
|
||||||
this.changeTheme(theme, customThemeConfig)
|
this.changeTheme(theme, customThemeConfig)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user