Getting warning from VSCode when using CharAt with Vuejs

Viewed 51

While trying to pick out the first character of a computed property I used charAt() function on it, but I am getting a little warning from VSCode that it is a wrong usage, although it is working.

computed: { ...mapGetters({ firstname: 'user/firstname', lastname: 'user/lastname', }), initials () { return (this.firstname.charAt(0).toUpperCase() + this.lastname.charAt(0).toUpperCase()); } },

Property 'charAt' does not exist on type 'Computed'.Vetur(2339) - This is the warning I get. Could not find much on this over the web

1 Answers

This is a warning caused by vetur.validation.interpolation which validate interpolations in region using TypeScript language service.

Setting vetur.experimental.templateInterpolationService: false in your settings.json file will solved this issue for you.

enter image description here

Related