Skip to content

Commit

Permalink
feat(directive): allow to not set element textContent from translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Demivan committed Aug 10, 2019
1 parent 3c7dfe4 commit b4f67fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ function translate(el: HTMLElement, fluent: FluentVueObject, binding: DirectiveB
return
}

el.textContent = fluent.formatPattern(msg.value, binding.value)
if (msg.value != null) {
el.textContent = fluent.formatPattern(msg.value, binding.value)
}

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

0 comments on commit b4f67fd

Please sign in to comment.