You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/components/vc-progress/demo/gap.jsx

73 lines
1.7 KiB

import { Circle } from '../index';
import '../assets/index.less';
7 years ago
export default {
data() {
7 years ago
return {
percent: 30,
color: '#3FC7FA',
};
7 years ago
},
methods: {
changeState() {
const colorMap = ['#3FC7FA', '#85D262', '#FE8C6A'];
const value = parseInt(Math.random() * 100, 10);
this.percent = value;
this.color = colorMap[parseInt(Math.random() * 3, 10)];
7 years ago
},
},
render() {
7 years ago
const circleContainerStyle = {
width: '200px',
height: '200px',
};
7 years ago
return (
<div>
<div style={circleContainerStyle}>
<Circle
percent={this.percent}
gapDegree="70"
gapPosition="top"
strokeWidth="6"
strokeLinecap="square"
7 years ago
strokeColor={this.color}
/>
</div>
<div style={circleContainerStyle}>
<Circle
percent={this.percent}
gapDegree="70"
gapPosition="bottom"
strokeWidth="6"
strokeLinecap="square"
7 years ago
strokeColor={this.color}
/>
</div>
<div style={circleContainerStyle}>
<Circle
percent={this.percent}
gapDegree="70"
gapPosition="left"
strokeWidth="6"
strokeLinecap="square"
7 years ago
strokeColor={this.color}
/>
</div>
<div style={circleContainerStyle}>
<Circle
percent={this.percent}
gapDegree="70"
gapPosition="right"
strokeWidth="6"
strokeLinecap="square"
7 years ago
strokeColor={this.color}
/>
</div>
<p>
<button onClick={this.changeState}>Change State</button>
</p>
</div>
);
7 years ago
},
};