"Authorization" is better written in dot notation.eslintdot-notation problem in Vuejs

Viewed 549

I want to add a default axios authorization bearer token in vuejs application:

axios.defaults.headers.common['Authorization'] = `Bearer ${userData.token}`

It is now looks ["Authorization"] is better written in dot notation.eslintdot-notation . When I want to save it, it changes to

`axios.defaults.headers.common.Authorization = `Bearer ${userData.token}`

It is not working. What is the problem with?

0 Answers
Related