0

i have small issue with vue.

I want to concatate string with variable, but i have error:

Unexpected string concatenation  / prefer-template

I want to concatate

const key = 'x: ' + cmd.event.text

i was trying to use:

      const name = cmd.event.text
      const key = 'x: ${name}'

but then i have different error:

 error    'name' is assigned a value but never used     no-unused-vars
  error    Unexpected template string expression        no-template-curly-in-string

Can you help me, how to concatate in vue?

Ilkar
  • 2,113
  • 9
  • 45
  • 71

1 Answers1

1

You need to use template literal.

const key = `x: ${name}`
raphael-pa
  • 49
  • 5