import React, { useState } from 'react'; import { Field, Input, Button, Fill, TextType } from '@xrnjs/ui'; import Card from '_global/Card'; const CodeDemo = () => { const [hasSent, setHasSent] = useState(false); return ( { if (hasSent) return; setHasSent(true); setTimeout(() => setHasSent(false), 3000); }} disabled={hasSent} > {hasSent ? '请稍等...' : '获取验证码'} } /> ); }; export default CodeDemo;