Es6 Arrow expression this

for example, I wrote
const fn = () = > {
this / / in test.js how to get this this to get the vue object?
}
export default fn
then in the vue file
import test from "test"

test.fn.bind (this) ()
but what if the this in fn is not a pointing vue object?

Aug.17,2021
Whether

is the this of the arrow function determines the scope when it is defined and cannot be changed. In this case, the arrow function


cannot be used.

define a variable outside this function equal to the vue object

let self = this;
const fn = () => {  
    //selfvue
}
Menu