Antonio Morales
Antonio Morales

Reputation: 1074

Quotes in vuejs templates

My component template vue.js file reports me some quote errors: enter image description here

The line with this code: :state="validateState('form.name')"

And the line with this code: :state="validateState('form.foods')"

How fix this for a Vue.js template?, this solution: :state="validateState("form.name")" not works for me

Upvotes: 0

Views: 2002

Answers (2)

Ömer Doğan
Ömer Doğan

Reputation: 691

if you are using single quotes anywhere, you cant use single quotes again inside there.

use template literals or care about single-double quotes.

Upvotes: 0

Michael Warner
Michael Warner

Reputation: 4257

The issue is from you using single quotes to declare your template.

template: '...'

I would suggest using the template literals and you don't need to include backslashes for end lines and such.

template: `...`

The other option you have is escaping the following single quote

template: '\'somestring\''

Upvotes: 3

Related Questions