1.父组件
<template>
<div id="rightmenu8">
<rightmenu7 ref="rightmenu7" @child="parent3" :age="age"></rightmenu7>
</div>
</template>
<script>
import rightmenu7 from "./RightMenu7.vue";
export default {
name: "rightmenu8",
data() {
return {
age:18
}
},
methods: {
},
components: {
rightmenu7: rightmenu7
}
};
</script>
2.子组件
<template>
<div id="rightmenu7" ></div>
</template>
<script>
export default {
props:[‘age‘],
name:"rightmenu7",
data(){
return{
}
}
}
</script>
<style>
</style>
原文地址:https://www.cnblogs.com/zhousen34/p/8817988.html
时间: 2024-11-05 23:32:53