Skip to content

Commit b4f67fd

Browse files
committed
feat(directive): allow to not set element textContent from translations
1 parent 3c7dfe4 commit b4f67fd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/directive.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ function translate(el: HTMLElement, fluent: FluentVueObject, binding: DirectiveB
1515
return
1616
}
1717

18-
el.textContent = fluent.formatPattern(msg.value, binding.value)
18+
if (msg.value != null) {
19+
el.textContent = fluent.formatPattern(msg.value, binding.value)
20+
}
1921

2022
for (const [attr] of Object.entries(binding.modifiers)) {
2123
el.setAttribute(attr, fluent.formatPattern(msg.attributes[attr], binding.value))

0 commit comments

Comments
 (0)