From 1ad0202ce6f8056a0c33097277cf51d0d8db37c4 Mon Sep 17 00:00:00 2001 From: pissang Date: Wed, 9 Feb 2022 12:41:26 +0800 Subject: [PATCH 1/2] fix(svg): fix shared vnode in pattern brings render issue --- src/svg/graphic.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/svg/graphic.ts b/src/svg/graphic.ts index ba4892197..6b081e1e0 100644 --- a/src/svg/graphic.ts +++ b/src/svg/graphic.ts @@ -29,7 +29,7 @@ import mapStyleToAttrs from './mapStyleToAttrs'; import { SVGVNodeAttrs, createVNode, SVGVNode, vNodeToString, BrushScope } from './core'; import { MatrixArray } from '../core/matrix'; import Displayable from '../graphic/Displayable'; -import { assert, isFunction, isString, logError, map, retrieve2 } from '../core/util'; +import { assert, clone, isFunction, isString, logError, map, retrieve2 } from '../core/util'; import Polyline from '../graphic/shape/Polyline'; import Polygon from '../graphic/shape/Polygon'; import { GradientObject } from '../graphic/Gradient'; @@ -538,7 +538,7 @@ function setPattern( } else if (val.svgElement) { // Only string supported in SSR. // TODO it's not so good to use textContent as innerHTML - child = val.svgElement; + child = clone(val.svgElement); patternAttrs.width = val.svgWidth; patternAttrs.height = val.svgHeight; } From 8e0e0d06b6e42ae5ffdc16ddd96a24b9552a196c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8B=BC=E6=97=8F=E5=B0=8F=E7=8B=88?= <1340641314@qq.com> Date: Mon, 14 Feb 2022 12:08:48 +0800 Subject: [PATCH 2/2] Update index.d.ts The type should not point to the source code, which will cause the upper layer to rely on the compilation type to report an error --- index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 21fff2ecb..047e18390 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,2 +1,2 @@ -export * from './src/zrender'; -export * from './src/export'; +export * from './lib/zrender'; +export * from './lib/export';