diff --git a/components/vc-progress/src/Circle.js b/components/vc-progress/src/Circle.js index b07bfa175..503b5ffae 100644 --- a/components/vc-progress/src/Circle.js +++ b/components/vc-progress/src/Circle.js @@ -20,9 +20,8 @@ Vue.use(ref, { name: 'ant-ref' }); const Circle = { props: initDefaultProps(circlePropTypes, circleDefaultProps), - data() { + created() { this.paths = {}; - return {}; }, methods: { getPathStyles(offset, percent, strokeColor, strokeWidth, gapDegree = 0, gapPosition) { diff --git a/components/vc-progress/src/Line.js b/components/vc-progress/src/Line.js index c728c481f..ff2956866 100644 --- a/components/vc-progress/src/Line.js +++ b/components/vc-progress/src/Line.js @@ -8,9 +8,8 @@ Vue.use(ref, { name: 'ant-ref' }); const Line = { props: initDefaultProps(propTypes, defaultProps), - data() { + created() { this.paths = {}; - return {}; }, render() { const { @@ -67,6 +66,7 @@ const Line = { stackPtg += ptg; const pathProps = { + key: index, attrs: { d: pathString, 'stroke-linecap': strokeLinecap, diff --git a/components/vc-progress/src/enhancer.js b/components/vc-progress/src/enhancer.js index 6b9ed1f0c..ff515472a 100644 --- a/components/vc-progress/src/enhancer.js +++ b/components/vc-progress/src/enhancer.js @@ -2,29 +2,27 @@ function enhancer(Component) { return { mixins: [Component], updated() { - this.$nextTick(() => { - const now = Date.now(); - let updated = false; + const now = Date.now(); + let updated = false; - Object.keys(this.paths).forEach(key => { - const path = this.paths[key]; + Object.keys(this.paths).forEach(key => { + const path = this.paths[key]; - if (!path) { - return; - } + if (!path) { + return; + } - updated = true; - const pathStyle = path.style; - pathStyle.transitionDuration = '.3s, .3s, .3s, .06s'; + updated = true; + const pathStyle = path.style; + pathStyle.transitionDuration = '.3s, .3s, .3s, .06s'; - if (this.prevTimeStamp && now - this.prevTimeStamp < 100) { - pathStyle.transitionDuration = '0s, 0s'; - } - }); - if (updated) { - this.prevTimeStamp = Date.now(); + if (this.prevTimeStamp && now - this.prevTimeStamp < 100) { + pathStyle.transitionDuration = '0s, 0s'; } }); + if (updated) { + this.prevTimeStamp = Date.now(); + } }, }; } diff --git a/components/vc-upload/src/IframeUploader.jsx b/components/vc-upload/src/IframeUploader.jsx index 49368d224..431af946e 100644 --- a/components/vc-upload/src/IframeUploader.jsx +++ b/components/vc-upload/src/IframeUploader.jsx @@ -70,7 +70,7 @@ const IframeUploader = { name: target.value && target.value.substring(target.value.lastIndexOf('\\') + 1, target.value.length), - });; + }); this.startUpload(); const { $props: props } = this; if (!props.beforeUpload) {