added fixes for bug plan 1.0.6RC01
Some checks failed
Chore App Build, Test, and Push Docker Images / build-and-push (push) Failing after 5m43s
Some checks failed
Chore App Build, Test, and Push Docker Images / build-and-push (push) Failing after 5m43s
This commit is contained in:
@@ -10,6 +10,7 @@ const props = defineProps<{
|
||||
imageFields?: readonly string[]
|
||||
isParentAuthenticated?: boolean
|
||||
filterFn?: (item: any) => boolean
|
||||
sortFn?: (a: any, b: any) => number
|
||||
getItemClass?: (item: any) => string | string[] | Record<string, boolean>
|
||||
enableEdit?: boolean
|
||||
childId?: string
|
||||
@@ -49,6 +50,7 @@ const fetchItems = async () => {
|
||||
// Try to use 'tasks', 'reward_status', or 'items' as fallback
|
||||
let itemList = data[props.itemKey || 'items'] || []
|
||||
if (props.filterFn) itemList = itemList.filter(props.filterFn)
|
||||
if (props.sortFn) itemList = [...itemList].sort(props.sortFn)
|
||||
items.value = itemList
|
||||
// Fetch images for each item
|
||||
await Promise.all(
|
||||
@@ -90,8 +92,19 @@ async function refresh() {
|
||||
defineExpose({
|
||||
refresh,
|
||||
items,
|
||||
centerItem,
|
||||
scrollToItem,
|
||||
})
|
||||
|
||||
const scrollToItem = async (itemId: string) => {
|
||||
await nextTick()
|
||||
const card = itemRefs.value[itemId]
|
||||
if (card) {
|
||||
;(card as HTMLElement).scrollIntoView({ behavior: 'smooth', block: 'nearest' })
|
||||
}
|
||||
await centerItem(itemId)
|
||||
}
|
||||
|
||||
const centerItem = async (itemId: string) => {
|
||||
await nextTick()
|
||||
const wrapper = scrollWrapper.value
|
||||
|
||||
Reference in New Issue
Block a user