We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import { useState } from 'react' import ReactDOM from 'react-dom' import { Radio, Input } from '@kdcloudjs/kdesign' const Demo: React.FC = () => { type Itype = Exclude<IAlertProps['type'], undefined> const [delayTime, setDelayTime] = React.useState<IAlertProps['delayOffTime']>(0) const ref = React.useRef<HTMLInputElement>(null) const map = { success: '成功提示', warning: '警告提示', error: '错误提示', info: '信息通知', } const getMessage = (type: Itype) => { return `这是${map[type]}类型的反馈浮层` } const demoButtonStyle = { margin: '0px 8px 8px 0' } const inputStyle = { marginBottom: 8, marginRight: 8, width: 230 } const handleTimeClick = () => { ref.current && setDelayTime((!isNaN(+ref.current.value) && +ref.current.value) || 0) } return ( <> <InputNumber ref={ref} style={inputStyle} placeholder="反馈浮层消息持续时间, ms为单位" digitLength={5} defaultValue={'1000'} /> <Button type="primary" style={demoButtonStyle} onClick={handleTimeClick}> 设置反馈浮层消息持续时间 </Button> {Object.keys(map).map((type: Itype) => { return <Alert key={type} message={getMessage(type)} type={type} delayOffTime={delayTime} /> })} </> ) } ReactDOM.render(<Demo />, mountNode)
组件库与浏览器均为最新版本
The text was updated successfully, but these errors were encountered:
fix: [alert] 修复ts类型报错 fix kingdee#972
e4e8c89
c911e94
3e84513
No branches or pull requests
重现链接或代码
重现问题步骤
期望的结果是什么
实际的结果是什么
组件库版本号、浏览器信息
组件库与浏览器均为最新版本
The text was updated successfully, but these errors were encountered: