子项样式修改

This commit is contained in:
liu
2026-08-11 10:47:12 +08:00
parent 029d2c400c
commit 1ffdab9358
3 changed files with 33 additions and 21 deletions
+18 -11
View File
@@ -1,5 +1,5 @@
import { View, Text } from '@tarojs/components'
import { Grid, GridItem, Loading } from '@antmjs/vantui'
import {Image, Loading, Tag} from '@antmjs/vantui'
import { useState, useEffect } from 'react'
import Taro from '@tarojs/taro'
import { getCategoryLinks } from '@/api/home'
@@ -49,16 +49,23 @@ export default function Category() {
) : links.length > 0 ? (
// 宫格链接(与首页宫格导航样式一致)
<View className='grid-wrapper'>
<Grid columnNum={5} border={false} gutter={12} iconSize={48}>
{links.map((item) => (
<GridItem
key={item.id}
icon={item.image.preview_url}
text={item.title}
onClick={() => navigateToLink(item.link)}
/>
))}
</Grid>
{links.map((item) => (
<View
className='grid-item'
key={item.id}
onClick={() => navigateToLink(item.link)}
>
<Image className='grid-item-image' src={item.image.preview_url}></Image>
<Text className='grid-item-title'>
<View>{item.title}</View>
<View>
{ item.tag.length > 0 && item.tag.map((tag, index) => (
<Tag type='danger' key={index}>{tag}</Tag>
))}
</View>
</Text>
</View>
))}
</View>
) : (
// 空状态