0
我正在使用office 365 progress bar。我从websocket获取数据(百分比)。现在我有下一个代码:为什么进度条总是显示100%?
export default class NotificationBar extends Component {
constructor(props) {
super(props);
this._async = new Async(this);
}
render(){
let { process } = this.props;// this object I get from flux store, it refreshes when web socket updates
return (
<ProgressIndicator
percentComplete={ this._getProgress() } />
)
};
_getProgress =() => {
let { process } = this.props;//here this.props.process.percent updates
return process.percent;
};
}
页面加载进度条变成100%后并没有改变,虽然我从方法得到百分比。我试图实验,并把在组件的渲染:
- PERCENTCOMPLETE = {0} -progressbar是空
- PERCENTCOMPLETE = {任何数量> 0}进度显示100%
什么可以是这种行为的原因?我犯了什么错误?
你说有一个'this.props.percent',但你要返回'this.props.process.percent'。哪一个? :) – Chris
有一个错误。它必须是this.props.process.percent.all已更正 –
PercentComplete是否在0和1之间? –