Vue 子組件接收父組件的值
阿新 • • 發佈:2018-04-13
import urn rom 組件 methods () bsp AR ret 1.父組件
<template>
<div id="rightmenu8">
<rightmenu7 ref="rightmenu7" @child="parent3" :age="age"></rightmenu7>
</div>
</template>
<script>
import rightmenu7 from "./RightMenu7.vue";
export default {
<template>
<div id="rightmenu7" ></div>
</template>
<script>
export default {
props:[‘age‘],
name:"rightmenu7",
data(){
return{
}
}
}
</script>
<style>
</style>
name: "rightmenu8", data() { return { age:18 } }, methods: { }, components: { rightmenu7: rightmenu7 } }; </script> 2.子組件
<style>
</style>
Vue 子組件接收父組件的值