Unexpected Template String Expression in Vue. Js

everytime I code like this ${row.name}, I get this error " Unexpected template string expression".

Any help?

2

3 Answers

ES6 template strings should be used with backquotes, not single quotes. Replace this :

'delete the item ${row.name}'

With this :

`delete the item ${row.name}`

And here is the ESLint example as requested in the comments :

0

If you are not using an ES6 template string and actually want the dollar sign to print to the screen, place the following above the string declaration.

/* eslint-disable no-template-curly-in-string */

Sometimes its necessary to use templating characters within string, like inside anchor tags, etc.

'<a href="${' +
'OrganizationInfo.PrivacyPolicy}" target="_blank" >Privacy Policy</a>'

Breaking the string worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest