🎉 Initial Commit(Migrated from Interactive)

This commit is contained in:
2024-03-27 23:07:18 +08:00
commit 3a1cf006f4
126 changed files with 4471 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<template>
<div class="post-list">
<v-infinite-scroll :items="props.posts" :onLoad="props.loader">
<template v-for="(item, idx) in props.posts" :key="item">
<div class="mb-3 px-1">
<v-card>
<template #text>
<post-item brief :item="item" @update:item="(val) => updateItem(idx, val)" />
</template>
</v-card>
</div>
</template>
</v-infinite-scroll>
</div>
</template>
<script setup lang="ts">
import PostItem from "@/components/posts/PostItem.vue"
const props = defineProps<{ posts: any[]; loader: (opts: any) => Promise<any> }>()
const emits = defineEmits(["update:posts"])
function updateItem(idx: number, data: any) {
const posts = JSON.parse(JSON.stringify(props.posts))
posts[idx] = data
emits("update:posts", posts)
}
</script>