File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
packages/vchart/src/component/indicator Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -209,7 +209,16 @@ export class Indicator<T extends IIndicatorSpec> extends BaseComponent<T> implem
209209 } as IndicatorAttributes ;
210210 }
211211
212- private _createOrUpdateIndicatorComponent ( attrs : IndicatorAttributes ) : IndicatorComponents {
212+ private _createOrUpdateIndicatorComponent ( attrs : IndicatorAttributes ) {
213+ if ( attrs . visible === false ) {
214+ // 按照vrender-component 的设置,只切换visible: false,并不会更新组件,所以强制删掉节点
215+ if ( this . _indicatorComponent && this . _indicatorComponent . parent ) {
216+ this . _indicatorComponent . parent . removeChild ( this . _indicatorComponent ) ;
217+ }
218+ this . _indicatorComponent = null ;
219+ return ;
220+ }
221+
213222 if ( this . _indicatorComponent ) {
214223 if ( ! isEqual ( attrs , this . _cacheAttrs ) ) {
215224 this . _indicatorComponent . setAttributes ( attrs ) ;
@@ -226,7 +235,6 @@ export class Indicator<T extends IIndicatorSpec> extends BaseComponent<T> implem
226235 ) ;
227236 }
228237 this . _cacheAttrs = attrs ;
229- return this . _indicatorComponent ;
230238 }
231239
232240 private _createText (
You can’t perform that action at this time.
0 commit comments