提交 ad87e1a3 authored 作者: 钟是志's avatar 钟是志

ProgressDiy 修改

上级 5078f36b
...@@ -6,6 +6,7 @@ import SpinPercent from './SpinPercent'; ...@@ -6,6 +6,7 @@ import SpinPercent from './SpinPercent';
export default function ProgressDiy(props) { export default function ProgressDiy(props) {
const { componentProps } = props; const { componentProps } = props;
const { progressDefaultProps } = componentProps;
const [data, setData] = useState(componentProps.data || {}); const [data, setData] = useState(componentProps.data || {});
const changeData = (newV) => { const changeData = (newV) => {
setData({ setData({
...@@ -28,7 +29,7 @@ export default function ProgressDiy(props) { ...@@ -28,7 +29,7 @@ export default function ProgressDiy(props) {
console.log(data); console.log(data);
return ( return (
<div> <div>
<SpinPercent {...data} /> <SpinPercent {...data} progressDefaultProps={progressDefaultProps}/>
</div> </div>
); );
} }
...@@ -15,6 +15,7 @@ export default function SpinPercent(props) { ...@@ -15,6 +15,7 @@ export default function SpinPercent(props) {
total, total,
speed, speed,
message, message,
progressDefaultProps,
} = props; } = props;
if(loadingPercent){ if(loadingPercent){
return ( return (
...@@ -28,6 +29,7 @@ export default function SpinPercent(props) { ...@@ -28,6 +29,7 @@ export default function SpinPercent(props) {
percent={percent} percent={percent}
status={status} status={status}
format={percent => `${speed}/${total}`} format={percent => `${speed}/${total}`}
{...progressDefaultProps}
/> />
<div className={styles.textCenter}> <div className={styles.textCenter}>
{message} {message}
......
...@@ -37,7 +37,16 @@ export default function DiyModal(props) { ...@@ -37,7 +37,16 @@ export default function DiyModal(props) {
}, },
}, },
component: 'ProgressDiy', component: 'ProgressDiy',
componentProps: {}, componentProps: {
progressDefaultProps: {
type: 'circle',
strokeColor: {
'0%': '#108ee9',
'100%': '#87d068',
},
width: 200,
},
},
}; };
}, []); }, []);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论