/** * title: 高级用法 * desc: 展示徽标的高级功能,如最大值限制、零值显示、加载状态等 */ import React, { useState } from 'react'; import { View, Text, TouchableOpacity } from 'react-native'; import { Badge, Space } from '@xrnjs/ui'; import Card from '_global/Card'; import { badgeStyles } from './style'; const AdvancedUsage: React.FC = () => { const [count, setCount] = useState(5); const [loading, setLoading] = useState(false); return ( 最大值限制 零值显示 动态控制 setCount(count + 1)} > 增加 setCount(Math.max(0, count - 1))} > 减少 setLoading(!loading)} > {loading ? '停止加载' : '开始加载'} 独立使用 ); }; export default AdvancedUsage;