gramener / uifactory

Simple HTML components
MIT License
7 stars 0 forks source link

Document element.render option for multiple props #3

Closed pratapvardhan closed 3 years ago

pratapvardhan commented 3 years ago

To re-render the element with multiple props, we could use the .render method?

<template component="two-props" a="a" b="b">
  <%= a %><%= b %>
</template>
document.querySelector('two-props').render({a: 1, b: 2})
// vs
document.querySelector('two-props').a = 1
document.querySelector('two-props').b = 2

or document a recommended way to update multiple props object in a single call?

sanand0 commented 3 years ago

The .render() method is the recommended way to render with multiple property updates. I'll document that.

sanand0 commented 3 years ago

Fixed via .update() in v0.0.5. See 29a9561