Babel replaces this with undefined

前端 未结 3 1908
[愿得一人]
[愿得一人] 2021-02-18 15:47

This code

beforeEach(() => {
        this.asd= \'123\';
        this.sdf= \'234\';
        this.dfg= \'345\';
        this.fgh= \'456\';
});

3条回答
  •  萌比男神i
    2021-02-18 16:15

    I had this issue, and changed my fat arrow function into a normal function, and it seemed to work again.

    () => {} 
    

    changed to

    function() {}
    

提交回复
热议问题