diff --git a/libs/horizon/src/external/JSXElement.ts b/libs/horizon/src/external/JSXElement.ts index c4ee4b9a..b654a841 100644 --- a/libs/horizon/src/external/JSXElement.ts +++ b/libs/horizon/src/external/JSXElement.ts @@ -13,7 +13,7 @@ export function JSXElement(type, key, ref, vNode, props, source) { return { // 元素标识符 vtype: TYPE_COMMON_ELEMENT, - source: source, + source: isDev ? source : null, // 属于元素的内置属性 type: type, diff --git a/libs/horizon/src/renderer/vnode/VNodeCreator.ts b/libs/horizon/src/renderer/vnode/VNodeCreator.ts index 60ab6064..3a7f7085 100644 --- a/libs/horizon/src/renderer/vnode/VNodeCreator.ts +++ b/libs/horizon/src/renderer/vnode/VNodeCreator.ts @@ -109,7 +109,6 @@ export function createUndeterminedVNode(type, key, props, source) { let vNodeTag = FunctionComponent; let isLazy = false; const componentType = typeof type; - if (componentType === 'function') { if (isClassComponent(type)) { vNodeTag = ClassComponent; @@ -132,7 +131,8 @@ export function createUndeterminedVNode(type, key, props, source) { if (isLazy) { vNode.lazyType = type; } - vNode.src = source; + + vNode.src = isDev ? source : null; return vNode; }