0

I am trying to concatenate two string values into a element, with no success thus far. This works fine:

    <v-toolbar-title
      class="hidden-sm-and-down font-weight-light"
      v-text="$route.name"
    />

But I need to concatenate the following to $route.name somehow: ' (' + {{sitename}} + ')' so that the value of local variable sitename follows the route name.

Is this possible to do in the v-text directive, or do I have to jump through hoops to assemble the string elsewhere?

1 Answer 1

2

I believe you could do something like this:

v-text="`${$route.name}(${sitename})`"

If you'd like to read more about string concatenation in ES6 you can have a look at this article.

Sign up to request clarification or add additional context in comments.

Comments

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.