1

How to assign a string and a string in the vue template?

<q-table
:title=`Lista de ${this.$route.params.tipo}`
/>

error Parsing error: Line 1: Unterminated template

3 Answers 3

4

It`s work

:title=' ` Lista de ${$route.params.tipo} ` '
Sign up to request clarification or add additional context in comments.

Comments

2

You forgot to add quotes around the template interpolation.

:title="`Lista de ${$route.params.tipo}`"

Comments

0

You do not use this in templates. Actually, everything in the template gets a this automatically.

:title=`Lista de ${\$route.params.tipo}`

Or in simple form, without template string:

:title='$route.params.tipo'

2 Comments

:title=Lista de ${$route.params.tipo} Does not work.
60:19 error 'v-bind' directives require an attribute value vue/valid-v-bind 60:26 error Parsing error: unexpected-character-in-unquoted-attribute-value vue/no-parsing-error 60:27 error Parsing error: Line 1: Unterminated template

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.