2016-11-24 110 views
0

觀察(ARR,回調)結合riot.jsJavaScript數組觀察

但是當我嘗試去觀察我的陣列我得到Array.observe不是一個函數

Array.observe(this.nodes, function (changes) 
{ 
    //do some stuff 
    tag.update(); 
}); 

錯誤

Uncaught TypeError: Array.observe is not a function(…)(anonymous function) 
@components/breadcrumb-navigation.tag.js:3(anonymous function) 
@ riot+compiler.js:1604(anonymous function) 
@ riot+compiler.js:1719each 
@ riot+compiler.js:1921toggle 
@ riot+compiler.js:1719(anonymous function) 
@ riot+compiler.js:1610mountTo 
@ riot+compiler.js:2417pushTags 
@ riot+compiler.js:2557each 
@ riot+compiler.js:1921pushTags 
@ riot+compiler.js:2561riot.mount 
@ riot+compiler.js:2612(anonymous function) 
@ riot+compiler.js:3497done 
@ riot+compiler.js:3414compileTag 
@ riot+compiler.js:3421GET.req.onreadystatechange 
@ riot+compiler.js:3381 
+0

我在幾周前使用了這個函數,它工作正常。所以今天我對這種行爲有點困惑 – Fesco

回答