mirror of https://github.com/halo-dev/halo
Add loading for post settings.
parent
dc52f30ade
commit
66fd2dc9c0
|
@ -490,11 +490,11 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleShowPostSettings(post) {
|
handleShowPostSettings(post) {
|
||||||
this.postSettingVisible = true
|
|
||||||
postApi.get(post.id).then(response => {
|
postApi.get(post.id).then(response => {
|
||||||
this.selectedPost = response.data.data
|
this.selectedPost = response.data.data
|
||||||
this.selectedTagIds = this.selectedPost.tagIds
|
this.selectedTagIds = this.selectedPost.tagIds
|
||||||
this.selectedCategoryIds = this.selectedPost.categoryIds
|
this.selectedCategoryIds = this.selectedPost.categoryIds
|
||||||
|
this.postSettingVisible = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 关闭文章设置抽屉
|
// 关闭文章设置抽屉
|
||||||
|
|
|
@ -7,6 +7,11 @@
|
||||||
@close="onClose"
|
@close="onClose"
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
:visible="visiable"
|
:visible="visiable"
|
||||||
|
>
|
||||||
|
<a-skeleton
|
||||||
|
active
|
||||||
|
:loading="settingLoading"
|
||||||
|
:paragraph="{ rows: 24 }"
|
||||||
>
|
>
|
||||||
<div class="post-setting-drawer-content">
|
<div class="post-setting-drawer-content">
|
||||||
<div :style="{ marginBottom: '16px' }">
|
<div :style="{ marginBottom: '16px' }">
|
||||||
|
@ -171,6 +176,7 @@
|
||||||
v-if="saveButton"
|
v-if="saveButton"
|
||||||
>保存</a-button>
|
>保存</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
</a-skeleton>
|
||||||
</a-drawer>
|
</a-drawer>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
@ -196,6 +202,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
thumDrawerVisible: false,
|
thumDrawerVisible: false,
|
||||||
categoryFormVisible: false,
|
categoryFormVisible: false,
|
||||||
|
settingLoading: true,
|
||||||
options: [],
|
options: [],
|
||||||
keys: ['blog_url'],
|
keys: ['blog_url'],
|
||||||
selectedPost: this.post,
|
selectedPost: this.post,
|
||||||
|
@ -249,6 +256,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.loadSkeleton()
|
||||||
this.loadOptions()
|
this.loadOptions()
|
||||||
this.loadCategories()
|
this.loadCategories()
|
||||||
},
|
},
|
||||||
|
@ -270,6 +278,11 @@ export default {
|
||||||
},
|
},
|
||||||
selectedCategoryIds(val) {
|
selectedCategoryIds(val) {
|
||||||
this.$emit('onRefreshCategoryIds', val)
|
this.$emit('onRefreshCategoryIds', val)
|
||||||
|
},
|
||||||
|
visiable: function(newValue, oldValue) {
|
||||||
|
if (newValue) {
|
||||||
|
this.loadSkeleton()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -282,6 +295,12 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
loadSkeleton() {
|
||||||
|
this.settingLoading = true
|
||||||
|
setTimeout(() => {
|
||||||
|
this.settingLoading = false
|
||||||
|
}, 500)
|
||||||
|
},
|
||||||
loadOptions() {
|
loadOptions() {
|
||||||
optionApi.listAll(this.keys).then(response => {
|
optionApi.listAll(this.keys).then(response => {
|
||||||
this.options = response.data.data
|
this.options = response.data.data
|
||||||
|
|
Loading…
Reference in New Issue