提交 09f2f8fc 编写于 作者: D DebugIsFalse

feature: 添加集合数据

上级 94af8616
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ULink to="/library/123"> <ULink to="/library/123">
<UCard :ui="cardUI"> <UCard :ui="cardUI">
<div class="flex flex-col gap-1"> <div class="flex flex-col gap-1">
<div>前端开发</div> <div>{{item.name}}</div>
<div class="flex"> <div class="flex">
<div class="flex items-center text-gray-500 text-sm gap-0.5"> <div class="flex items-center text-gray-500 text-sm gap-0.5">
<UIcon name="i-heroicons-square-3-stack-3d" /> <UIcon name="i-heroicons-square-3-stack-3d" />
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
</ULink> </ULink>
</template> </template>
<script setup> <script setup>
defineProps({
item: {
type: Object,
default: (() => {})()
}
})
const cardUI = { const cardUI = {
body: { body: {
padding: 'sm:p-3 p-3', padding: 'sm:p-3 p-3',
......
...@@ -25,8 +25,10 @@ ...@@ -25,8 +25,10 @@
/> />
</div> </div>
<div class="flex flex-col gap-4 mt-4"> <div class="flex flex-col gap-4 mt-4">
<ILibraryCollect /> <ILibraryCollect
<ILibraryCollect /> v-for="item in collection"
:item="item"
/>
</div> </div>
</div> </div>
</div> </div>
...@@ -35,8 +37,17 @@ ...@@ -35,8 +37,17 @@
</template> </template>
<script setup> <script setup>
const { $openLibraryCreate } = useLibraryStore() const { $openLibraryCreate } = useLibraryStore()
const { getCollection } = useCollectionRequest()
function handleOpenCreateLibrary () { function handleOpenCreateLibrary () {
$openLibraryCreate() $openLibraryCreate()
} }
// 合集列表
const collection = ref([])
async function getCollectionData () {
collection.value = await getCollection()
}
nextTick(() => {
getCollectionData()
})
</script> </script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册