import { Circle } from '../index'; import '../assets/index.less'; const colorMap = ['#3FC7FA', '#85D262', '#FE8C6A']; function getColor(index) { return colorMap[(index + colorMap.length) % colorMap.length]; } export default { data() { return { percent: 30, colorIndex: 0, }; }, methods: { changeState() { const value = parseInt(Math.random() * 100, 10); const colorIndex = parseInt(Math.random() * 3, 10); this.percent = value; this.colorIndex = colorIndex; }, }, render() { const circleContainerStyle = { width: '200px', height: '200px', }; const { percent, colorIndex } = this; const color = getColor(colorIndex); return (