<!-- parent -->
<template>
??<p>我是父親, 對(duì)兒子說: {{sthGiveChild}}</p>
??<Child v-model="sthGiveChild"></Child>
</p>
</template>
<script>
import Child from?'./Child.vue';
export?default?{
??data() {
????return?{
??????sthGiveChild:?'學(xué)習(xí)vue'
????};
??},
??components: {
????Child
??}
}
</script>
<!-- child -->
<template>
??<p>我是兒子,父親對(duì)我說: {{give}}</p>
??<a href="javascript:;"?rel="external nofollow"?rel="external nofollow"?rel="external nofollow"?@click="returnBackFn">回應(yīng)</a>
</p>
</template>
<script>
export?default?{
??props: {
????give: String
??},
??model: {
????prop:?'give',
????event:?'returnBack'
??},
??methods: {
????returnBackFn() {
??????this.$emit('returnBack',?'學(xué)習(xí)vue很好');
????}
??}
}
</script>