Skip to content

Commit

Permalink
fix(tables): scroll to top on activated
Browse files Browse the repository at this point in the history
  • Loading branch information
ZonaHex committed Mar 6, 2024
1 parent dc4515a commit 25651c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/views/dashboard/modules/table-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ a-spin(style="width: 100%" :loading="tablesLoading")
const treeRef = ref()
const expandedKeys = ref<number[]>()
onActivated(() => {
treeRef.value?.scrollIntoView({ top: 0 })
})
const refreshTables = () => {
tablesSearchKey.value = ''
getTables()
Expand Down
11 changes: 10 additions & 1 deletion src/views/dashboard/modules/table-manager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ a-card.table-manager(:bordered="false")
template(#title)
a-space(:size="10")
| Tables
a-button(type="outline" size="small" @click="refreshTables" :loading="totalTablesLoading")
a-button(
type="outline"
size="small"
:loading="totalTablesLoading"
@click="refreshTables"
)
template(#icon)
svg.icon.brand-color
use(href="#refresh")
Expand Down Expand Up @@ -172,6 +177,10 @@ a-card.table-manager(:bordered="false")
const expandedKeys = ref<number[]>()
onActivated(() => {
tablesTreeRef.value?.scrollIntoView({ top: 0 })
})
const expandChildren = (event: Event, nodeData: TableTreeParent, type: 'details' | 'columns') => {
if (nodeData[type].length && type !== nodeData.childrenType && expandedKeys.value?.includes(nodeData.key)) {
event.stopPropagation()
Expand Down

0 comments on commit 25651c5

Please sign in to comment.