I am new to VueJs and I have a problem with two components. I am trying to display a component with vuejs router and I must pass properties to that component and since it's not a child of that component (it's in different directory), how can I pass data to that component? For example:
This is a Parent component:
<template>
<div class="container">
<router-link to="/Form"></router-link>
</div>
</template>
<script>
export default{
data(){
return{
values: {val1: 123, val2: 321}
}
}
}
</script>
This is a components that needs properties, Form component:
<template>
<div class="container">
<form>
<input type="text" v-model="values.val1"/>
<input type="number" v-model="values.val2"/>
</form>
</div>
</template>
<script>
export default{
props: {
values: {
type: Object
}
}
}
</script>