riot.js tag each
公式但し書きにあるようにeach={...}は動かない。 each="{...}"とする。 riot.tagで困ったらとりあえず{}を"{}"にしてみる。
riot.tag(`todo`
,`<ul><li each="{ item in items }">{ item }</li></ul>`
,function (opts){this.items = opts.items
})
riot.mount('todo',{items:[0,1,2,3]})
;
<script src="//gnjo.github.io/riot.js"></script>
<todo></todo>
この時のerrorは replace...
riot.js:2 Uncaught TypeError: Cannot read property 'replace' of undefined
at l (VM5871 riot.js:2)
at VM5871 riot.js:2
at VM5871 riot.js:2
at r (VM5871 riot.js:2)
at Object.b.update (VM5871 riot.js:2)
at Object.Ft (VM5871 riot.js:2)
at vt (VM5871 riot.js:2)
at Object.Kt (VM5871 riot.js:2)
at Object.<anonymous> (VM5871 riot.js:2)
at VM5871 riot.js:2
Author And Source
この問題について(riot.js tag each), 我々は、より多くの情報をここで見つけました https://qiita.com/HadaGunjyo/items/b082869bf43744843e28著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .