Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

boyjarv's avatar

Linking string and dynamic in vue?

the following doesn't seem to work, please help

<a :href="course/{{ course._id }}">{{ course.en.config.coursename }}</a>
0 likes
3 replies
tykus's avatar

Use a template string for the URL

<a :href="`course/${course._id}`">{{ course.en.config.coursename }}</a>
boyjarv's avatar

I actually need to use router-link

tykus's avatar

@boyjarv same thing then:

<router-link :to="`/course/${course._id}`">{{ course.en.config.coursename }}</router-link>

Please or to participate in this conversation.