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> <template>
<a-row :gutter="0"> <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"> <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-spin>
</a-col> </a-col>
<a-col :md="18" :sm="24" class="h-screen"> <a-col :md="19" :sm="24" class="h-screen">
<iframe <iframe
id="themeViewIframe" id="themeViewIframe"
:src="options.blog_url" :src="options.blog_url"
@ -57,6 +63,9 @@ export default {
this.theme.loading = false this.theme.loading = false
} }
}, },
handleRouteToThemeSetting() {
this.$router.push({ name: 'ThemeSetting', query: { themeId: this.theme.id } })
},
onSettingsSaved() { onSettingsSaved() {
document.getElementById('themeViewIframe').contentWindow.location.reload() document.getElementById('themeViewIframe').contentWindow.location.reload()
} }

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

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

Loading…
Cancel
Save