0

The parent makes some computation before passing down the attribute

<parent>
    <child src={compute(opts.src)}></child>
</parent>

It doesn't work.

http://plnkr.co/edit/MguuodHHRlVytnikQKZ7?p=preview

How to achieve this?

It is very basic fixture in Web Component.

Henrik Andersson
  • 45,354
  • 16
  • 98
  • 92
Hiep
  • 2,483
  • 1
  • 25
  • 32

1 Answers1

2

RiotJS converts the src property in the opts object to a property called riotSrc due to not allowing illegal server requests when using src="" on tags.

<child>
  <div>This is the original property: {opts.origin}</div>
  <div>This is the computed property: {opts.riotSrc}</div>
</child>
Henrik Andersson
  • 45,354
  • 16
  • 98
  • 92