From 6f21eb866771744b98423c869da5a717c131ad7f Mon Sep 17 00:00:00 2001 From: erweixin <2991552132@qq.com> Date: Fri, 10 Jan 2025 11:35:59 +0800 Subject: [PATCH] fix(template): prevent default values from overriding props --- packages/shared/src/template.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared/src/template.ts b/packages/shared/src/template.ts index f33d62bbffe..6710c432115 100644 --- a/packages/shared/src/template.ts +++ b/packages/shared/src/template.ts @@ -175,7 +175,7 @@ export class BaseTemplate { ? `xs.d(i.${propAlias})` : `i.${propAlias}===undefined?${propValue}:i.${propAlias}` } else { - propValue = `i.${propAlias}||${propValue || singleQuote('')}` + propValue = `i.${propAlias}!==undefined?i.${propAlias}:${propValue || singleQuote('')}` } prop = this.replacePropName(prop, propValue, compName, componentAlias)