Skip to content

Commit

Permalink
fix(template): prevent default values from overriding props
Browse files Browse the repository at this point in the history
  • Loading branch information
erweixin committed Jan 10, 2025
1 parent 6964768 commit 6f21eb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared/src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6f21eb8

Please sign in to comment.