Skip to content

Commit

Permalink
fix(form): query default fold errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhaocl1997 committed Aug 29, 2022
1 parent d407011 commit 641c8d3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
16 changes: 10 additions & 6 deletions src/components/UI/Form/src/components/Extend/Query.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
const { t } = useAppI18n()
const active = ref(props.defaultFold)
const active = ref(false)
const getText = computed(() =>
active.value ? t('app.button.expand') : t('app.button.collapse')
Expand Down Expand Up @@ -103,11 +103,15 @@
}
}
onMounted(() => {
if (props.defaultFold) {
for (let i = props.countToFold!; i < formSchemas.value.length; i++) {
formSchemas.value[i]._internalShow = false
watch(
() => props.defaultFold,
(v) => {
if (v) {
onToggle()
}
},
{
immediate: true,
}
})
)
</script>
3 changes: 1 addition & 2 deletions src/views/system/log/operate/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@
type: 'Extend:Query',
componentProp: {
foldable: true,
// TODO internalShow not trigger rerender
// defaultFold: true,
defaultFold: true,
countToFold: 2,
},
},
Expand Down
3 changes: 1 addition & 2 deletions src/views/system/log/signin/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@
type: 'Extend:Query',
componentProp: {
foldable: true,
// TODO internalShow not trigger rerender
// defaultFold: true,
defaultFold: true,
countToFold: 2,
},
},
Expand Down

0 comments on commit 641c8d3

Please sign in to comment.