Untitled
unknown
plain_text
2 years ago
489 B
12
Indexable
//Define route
const routes = [
{
path: '/search/:id',
component: SearchUser,
name: 'ABC',
props: route => ({ data: route.params.data, id: route.params.id })
}
]
this.$router.push({ name: 'ABC', params: { data: [], id: 123 } });
//Define props in SearchUser component
<template>
<div>
<p>ID: {{ id }}</p>
<p>Data: {{ data }}</p>
</div>
</template>
<script>
export default {
props: {
data: Array
}
}
</script>Editor is loading...
Leave a Comment