This statement shows that there is a syntax error. How should I correct it?

 showInfoBtn() {
                return
                (this.personAuth === "specialist"
                    || this.personAuth === "dispatcher"
                    || this.personAuth === "doctor")
            },

this statement shows that there is a syntax error. How should I correct it?

Jun.14,2022

if you don't take a screenshot, you can't see the syntax error. Isn't it troublesome to make such a judgment?

return ['speciallist', 'dispatcher', 'doctor'].includes(this.personAuth)

if an error is reported, first see what the error prompt is. If it is not a logic error, you also use eslint , then it is definitely a format problem, such as no space between function name and () , , no space after , incorrect indentation, and so on.


 showInfoBtn() {
                return (this.personAuth === 'specialist'
                        || this.personAuth === 'dispatcher'
                        || this.personAuth === 'doctor')
            },

change it to this


the first floor solution is more elegant

Menu