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...
everytime I code like this ${row.name}, I get this error " Unexpected template string expression".
Any help?
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 :
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.