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

umerfayyaz's avatar

Vue router-link gives Unexpected token, expected ","

Hi. When i added a link in vue router link then it gives this error lara.png

<template>
	<div class="row container mt-5" style="margin-left: 90px;">
		<div class="col-md-4" v-for="i in data" :key="i">
			<div class="card container mb-2 mt-2 d-flex flex-wrap align-content-stretch bg-light" style="height: 250px;">
				
				<div class="card-body">
					<router-link :to="{name:'bookable' , params: {i.id} }"><h1>{{i.title}}</h1></router-link>
					<p>{{i.description}}</p>

				</div>
				
			</div>
		</div>
	</div>
</template>

this is the child component. Thanks for any help

0 likes
2 replies
Talinon's avatar
Talinon
Best Answer
Level 51

@umerfayyaz

Params should be a key/value pair. Perhaps you meant:

<router-link :to="{name:'bookable' , params: {id:i.id} }"><h1>{{i.title}}</h1></router-link>

Please or to participate in this conversation.