|
@@ -1,9 +1,9 @@
|
|
<template>
|
|
<template>
|
|
<div class="test-comp">
|
|
<div class="test-comp">
|
|
<h1>组件测试页面</h1>
|
|
<h1>组件测试页面</h1>
|
|
- <TestComp1 str="hello world!"></TestComp1>
|
|
|
|
|
|
+ <TestComp1 str="hello world!" @parentHandle="getVal"></TestComp1>
|
|
<!-- <TestComp1 v-bind:str="str1"></TestComp1> -->
|
|
<!-- <TestComp1 v-bind:str="str1"></TestComp1> -->
|
|
- <TestComp1></TestComp1>
|
|
|
|
|
|
+ <!-- <TestComp1></TestComp1> -->
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -28,6 +28,11 @@ export default {
|
|
console.log(to, from, next)
|
|
console.log(to, from, next)
|
|
next()
|
|
next()
|
|
},
|
|
},
|
|
|
|
+ methods: {
|
|
|
|
+ getVal(val){
|
|
|
|
+ console.log("父组件接收子组件传来的值"+val);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
components:{
|
|
components:{
|
|
TestComp1
|
|
TestComp1
|
|
}
|
|
}
|