0

I have following code in vue.js file

<p>{{match.tournament_name}}<p>

Above code will print tournament name inside p tag.

Now I want to pass match.tournament_name as query string for my a tag. But I am not sure how to do string interpolation in Vue.js. I have tried like this

<a href="/score_cards/new?tournament_name={{match.tournament_name}}">Upload Score Card</a>

But above string interpolation doesn't work. So How can I pass match.tournament_name as query string ?

1 Answer 1

3

For that you can use v-bind attributes. For example:

<a v-bind:href="`/score_cards/new?tournament_name=${match.tournament_name}`">Upload Score Card</a>

Also you can use reduction :href instead of v-bind:href

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.