在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ 這個方法在forEach外this.tag_choose_options有值,里

這個方法在forEach外this.tag_choose_options有值,里邊undefined?

  update(even){
            console.log(even);
            alert(JSON.stringify(this.tag_choose_options));
            even.forEach(function (item) {
                alert(JSON.stringify(this.tag_choose_options));
                // this.tag_choose_options.push({label:item.name});
                // this.tag_choose_options.push({"value":557275,"label":"我的","count":11}),
                // console.log(item);
                alert(item.name);
            })
        },

這個方法在forEach外this.tag_choose_options有值,里邊undefined怎么回事?

回答
編輯回答
憶當年

this指向變了,你console.log(this)會發(fā)現(xiàn)是even

2017年9月26日 12:55