I want to click on component B to add data to component A
component A
<template>
<div>
<ul>
<li v-for="(item, index) in list" :key=index>{{item}}</li>
</ul>
<router-link to="/b">B</router-link>
</div>
</template>
<script>
export default {
name: "A",
data () {
return {
list: ["a", "b", "c"]
}
}
}
</script>
<style scoped>
</style>
component B
<template>
<div>
<input type="text" v-model="msg">
<button @click="add"></button>
</div>
</template>
<script>
export default {
name: "B",
data () {
return {
msg: ""
}
},
methods: {
add () {
}
}
}
</script>
<style scoped>
</style>