Skip to content

Commit

Permalink
fix(plugin-page): setting home should not close settingPanel
Browse files Browse the repository at this point in the history
  • Loading branch information
chilingling committed Feb 19, 2024
1 parent caeb540 commit cec171a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/plugins/page/src/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</template>

<script lang="jsx">
import { reactive, ref, watchEffect } from 'vue'
import { reactive, ref, watchEffect, provide } from 'vue'
import { useCanvas, useApp, useResource, usePage, useHelp } from '@opentiny/tiny-engine-controller'
import { PluginPanel, SvgButton, LinkButton } from '@opentiny/tiny-engine-common'
import { extend } from '@opentiny/vue-renderless/common/object'
Expand Down Expand Up @@ -132,6 +132,8 @@ export default {
initCurrentPageData(pageDetail)
}
provide('openSettingPanel', openSettingPanel)
const pluginPanelClosed = () => {
closePageSettingPanel()
closeFolderSettingPanel()
Expand Down
7 changes: 4 additions & 3 deletions packages/plugins/page/src/PageHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
</template>

<script>
import { computed, reactive, watchEffect } from 'vue'
import { computed, reactive, watchEffect, inject } from 'vue'
import { Checkbox } from '@opentiny/vue'
import { usePage, useModal, useNotify } from '@opentiny/tiny-engine-controller'
import { isVsCodeEnv } from '@opentiny/tiny-engine-common/js/environments'
import { generateRouter } from '@opentiny/tiny-engine-common/js/vscodeGenerateFile'
import { closePageSettingPanel } from './PageSetting.vue'
import http from './http.js'
export default {
Expand Down Expand Up @@ -53,6 +52,8 @@ export default {
return home
})
const openSettingPanel = inject('openSettingPanel')
const settingHome = () => {
confirm({
title: '提示',
Expand All @@ -69,7 +70,7 @@ export default {
handleRouteHomeUpdate(id, params)
.then(() => {
pageSettingState.updateTreeData()
closePageSettingPanel()
openSettingPanel({ data: pageSettingState.currentPageData })
pageSettingState.isNew = false
if (isVsCodeEnv) {
generateRouter({
Expand Down

0 comments on commit cec171a

Please sign in to comment.