I need to pass a value using router.push in this component:
<template>
//some html
</template>
<script>
export default {
data(){
//some data
},
methods: {
uploadTemplate(event) {
if(everythingWell){
this.$router.push({name: 'upload-document', params: {value: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8ce9f4ede1fce0e9cce9e1ede5e0a2efe3e1">[email protected]</a>"}})
}
}
}
}
</script>
**my router: **
const routes = [
{
path: '/upload',
name: 'upload-document',
props: {
default: true
},
component: () => import('./../modules/doc_templates/pages/UploadDocPage.vue')
}
]
const router = createRouter({
history: createWebHashHistory(),
routes,
})
export default router;
And the upload component, where I should use the props:
<template>
<div>
<p>value: {{ this.value }} </p>
</div>
</template>
<script>
export default {
props: {
value: String
}
}
When navigating to the upload route, the value of "value" is undefined. The browser displays the following message:
[Vue Router warn]: Discarded invalid param(s) "value" when navigating.
I have tried using props but the issue persists.