Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugin-page): setting home should not close settingPanel #308

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading