有什么方法可以选择当前标签作为DOM元素而不使用id属性? 我现在在做的是; function addAttr(n,v){
var ta = document.getElementById(opts.id);
ta.setAttribute(n,v);
}
我正在寻找一些像这样的直接方式; function addAttr(n,v){
var ta = docu
让我们假设我们有一个防暴SPA这样的: 的index.html: <my-tag></my-tag>
<script type="riot/tag" src="my-tag.riot"></script>
<script>
//OK we need a compile() wrapper to access all tag instances
var tags;
riot.compile
我看过很多类似的问题,但仍然难以完成。 Try-d observable-s,但搞乱了某处并且无法完成。新仍然 riotjs在子标签,我有,将资料列表的功能: <make-list>
...lots of html...
<script>
var piclist = []; --after first function run this list has data
....