Skip to content

Commit b4f8608

Browse files
committed
fix: clean up interface.js
1 parent cfe8315 commit b4f8608

File tree

2 files changed

+10
-26
lines changed

2 files changed

+10
-26
lines changed

src/components/VueEllipseProgress.vue

+5-14
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,15 @@
3636

3737
<script>
3838
import { getNumberIfValid, isValidNumber } from "../utils";
39-
import { props } from "./interface";
39+
import props from "./interface";
4040
import CircleContainer from "./Circle/CircleContainer.vue";
4141
import Counter from "./Counter.vue";
4242
import parseOptions from "./optionsParser";
4343
4444
export default {
4545
name: "VueEllipseProgress",
4646
components: { Counter, CircleContainer },
47-
props: {
48-
...props,
49-
legendFormatter: {
50-
type: Function,
51-
required: false,
52-
},
53-
},
47+
props,
5448
data: () => ({
5549
counterTick: {},
5650
}),
@@ -75,10 +69,10 @@ export default {
7569
},
7670
circlesData() {
7771
if (this.isMultiple) {
78-
return this.data.map((data) => ({
72+
return this.data.map((options) => ({
7973
...this.$props,
80-
...data,
81-
emptyThickness: isValidNumber(data.thickness) ? data.thickness : this.$props.thickness,
74+
...options,
75+
emptyThickness: isValidNumber(options.thickness) ? options.thickness : this.$props.thickness,
8276
data: undefined, // do not pass data prop
8377
}));
8478
}
@@ -107,9 +101,6 @@ export default {
107101
return normalizedCircles;
108102
},
109103
},
110-
beforeCreate() {
111-
console.log(this);
112-
},
113104
};
114105
</script>
115106

src/components/interface.js

+5-12
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const colorConfig = (defaultColor = "transparent") => ({
1313
},
1414
});
1515

16-
const props = {
16+
export default {
1717
data: {
1818
type: Array,
1919
required: false,
@@ -160,15 +160,8 @@ const props = {
160160
required: false,
161161
default: false,
162162
},
163+
legendFormatter: {
164+
type: Function,
165+
required: false,
166+
},
163167
};
164-
165-
const simplifiedProps = {};
166-
167-
for (const p in props) {
168-
simplifiedProps[p] = {
169-
type: props[p].type,
170-
default: props[p].default,
171-
};
172-
}
173-
174-
export { props, simplifiedProps };

0 commit comments

Comments
 (0)