1
0
forked from bot/app
LiteyukiBot/docs/.vuepress/components/res_store.vue

39 lines
770 B
Vue
Raw Normal View History

2024-04-07 03:24:13 +08:00
<script setup lang="ts">
import {ref} from 'vue'
2024-04-20 04:10:20 +08:00
import ItemCard from './res_item_card.vue'
2024-04-07 03:24:13 +08:00
// 从public/assets/resources.json加载插件
let items = ref([])
2024-04-20 04:10:20 +08:00
fetch('https://bot.liteyuki.icu/assets/resources.json')
2024-04-07 03:24:13 +08:00
.then(response => response.json())
.then(data => {
items.value = data
2024-06-02 23:15:38 +08:00
2024-04-07 03:24:13 +08:00
})
.catch(error => console.error(error))
</script>
<template>
<div>
<h1>主题/资源商店</h1>
<div class="market">
<!-- 布局商品-->
2024-06-02 23:15:38 +08:00
<ItemCard v-for="item in [...items].reverse()" :key="item.id" :item="item" />
2024-04-07 03:24:13 +08:00
</div>
</div>
</template>
<style scoped>
h1 {
color: #00a6ff;
text-align: center;
font-weight: bold;
}
.market {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
gap: 10px;
}
</style>