Browse Source

feat: theme visual settings page add back button (#514)

Signed-off-by: Ryan Wang <i@ryanc.cc>
pull/517/head
Ryan Wang 3 years ago committed by GitHub
parent
commit
29073465ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      src/views/interface/ThemeVisualSetting.vue
  2. 1
      src/views/interface/components/ThemeSettingForm.vue

15
src/views/interface/ThemeVisualSetting.vue

@ -1,11 +1,17 @@
<template>
<a-row :gutter="0">
<a-col :md="6" :sm="24" class="h-screen" style="border-right: 1px solid #f2f2f2">
<a-col :md="5" :sm="24" class="h-screen" style="border-right: 1px solid #f2f2f2">
<a-spin :spinning="theme.loading" class="h-full">
<ThemeSettingForm :theme="theme.data" :wrapperCol="{ span: 24 }" @saved="onSettingsSaved" />
<ThemeSettingForm :theme="theme.data" :wrapperCol="{ span: 24 }" @saved="onSettingsSaved">
<template #descriptions-item>
<a-descriptions-item>
<a-button @click="handleRouteToThemeSetting()">返回</a-button>
</a-descriptions-item>
</template>
</ThemeSettingForm>
</a-spin>
</a-col>
<a-col :md="18" :sm="24" class="h-screen">
<a-col :md="19" :sm="24" class="h-screen">
<iframe
id="themeViewIframe"
:src="options.blog_url"
@ -57,6 +63,9 @@ export default {
this.theme.loading = false
}
},
handleRouteToThemeSetting() {
this.$router.push({ name: 'ThemeSetting', query: { themeId: this.theme.id } })
},
onSettingsSaved() {
document.getElementById('themeViewIframe').contentWindow.location.reload()
}

1
src/views/interface/components/ThemeSettingForm.vue

@ -34,6 +34,7 @@
<a-descriptions-item label="存储位置">
{{ theme.themePath }}
</a-descriptions-item>
<slot name="descriptions-item" />
</a-descriptions>
</a-tab-pane>
<a-tab-pane v-for="(group, index) in form.configurations" :key="index + 1" :tab="group.label">

Loading…
Cancel
Save