This method has a value outside this.tag _ choose_options and undefined? inside

  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);
            })
        },

this method has a value in this.tag _ choose_options outside of forEach. what"s going on inside undefined?

Apr.03,2021

the this direction has changed, and your console.log (this) will find that it is even

.
Menu