有什麼方法可以選擇當前標籤作爲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
....