How to write in vue methods?

methods: {
    setCameraPostion: (()=>{
        let _eye = new Vector3();
        let eyeDirection = new Vector3();
        let target = new Vector3();
        let distance, newDistance;
        return function setCameraPostion(args) {
            _eye.copy(args.pos).sub(target);
            eyeDirection.copy(_eye).normalize();
            distance = _eye.length();
            newDistance = ...();
            eyeDirection.setLength(newDistance).add(target);
            return eyeDirection;
        }
    })(),
}

the above method of writing is enforceable. What I want to ask is whether it is advisable to write in this way. Does it need to be optimized?
personally, I feel that this kind of auxiliary variable is very awkward to be written in data. Obsessive-compulsive disorder is fast
, but the disadvantage is that I can"t use this--. I don"t know how to use
. Thank you

.
May.22,2021
The life cycle of

vuejs provides a good opportunity to call a method. Writing closures in a method for immediate execution is unnecessary, complicated and wastes the convenience of using this .


if there are multiple instances of this component, SetCameraPostion method in all instances share the _ eye,eyeDirection,target,distance,newDistance variable
and cannot use this because you declare method

with the arrow function.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b41599-2bd03.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b41599-2bd03.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?