File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
packages/@vue/cli-ui-addon-webpack/src/components Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 28
28
>
29
29
<DonutModule
30
30
v-for =" module of module.children"
31
+ v-if =" isVisible(getRatio(module, ratio))"
31
32
:key =" module.id"
32
33
:module =" module"
33
34
:depth =" depth + 1"
@@ -96,7 +97,7 @@ export default {
96
97
},
97
98
98
99
ratio () {
99
- return this .module . size [ this .sizeField ] / this . module . parent . size [ this . sizeField ] * this .parentRatio
100
+ return this .getRatio ( this .module , this .parentRatio )
100
101
},
101
102
102
103
rotation () {
@@ -112,7 +113,7 @@ export default {
112
113
},
113
114
114
115
visible () {
115
- return this .ratio > .002
116
+ return this .isVisible ( this . ratio )
116
117
},
117
118
118
119
hover () {
@@ -124,7 +125,17 @@ export default {
124
125
if (this .visible ) {
125
126
this .dasharray = this .$refs .path .getTotalLength ()
126
127
}
127
- }
128
+ },
129
+
130
+ methods: {
131
+ getRatio (module , parentRatio ) {
132
+ return module .size [this .sizeField ] / module .parent .size [this .sizeField ] * parentRatio
133
+ },
134
+
135
+ isVisible (ratio ) {
136
+ return ratio > .0025
137
+ }
138
+ },
128
139
}
129
140
</script >
130
141
You can’t perform that action at this time.
0 commit comments