Skip to content

Commit

Permalink
fix: 修复常规发布返回异常问题
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Aug 6, 2023
1 parent 8079a87 commit f0ba519
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/components/common/BackPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// uses
import { useVueI18n } from "~/src/composables/useVueI18n.ts"
import { useRoute, useRouter } from "vue-router"
import { reactive, ref } from "vue"
import { ref } from "vue"
import { createAppLogger } from "~/src/utils/appLogger.ts"
import { ArrowLeft } from "@element-plus/icons-vue"
Expand All @@ -43,6 +43,10 @@ const props = defineProps({
type: String,
default: "",
},
hasBackEmit: {
type: Boolean,
default: false,
},
})
// datas
Expand All @@ -52,8 +56,11 @@ const showBack = ref(query.showBack === "true")
const emit = defineEmits(["backEmit"])
const onBack = () => {
if (emit && emit("backEmit") as any) {
if (emit && props.hasBackEmit) {
logger.info("using backEmit do back")
emit("backEmit")
} else {
logger.warn("no backEmit, using router handle back")
router.back()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/publish/SinglePublishDoPublish.vue
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ onMounted(async () => {
</script>

<template>
<back-page title="常规发布" @backEmit="onBack">
<back-page title="常规发布" :has-back-emit="true" @backEmit="onBack">
<el-skeleton class="placeholder" v-if="!formData.isInit" :rows="5" animated />
<div v-else id="batch-publish-index">
<el-alert class="top-tip" :title="getTitle()" type="info" :closable="false" />
Expand Down

0 comments on commit f0ba519

Please sign in to comment.