lijh
2022-01-14 d629d9ee09eb91be19fd21f04f78a89f7d837c3a
commit | author | age
bf6fbe 1 <template>
L 2     <div>
3         <component-a ref="comA"></component-a>
4     </div>
5 </template>
6 <script>
7     import componentA from "./B.vue"
8     export default {
9         components: {
10             componentA
11         },
12         mounted() {
13             const comA = this.$refs.comA;
14             console.log(comA.name); // Vue.js
15             comA.sayHello(); // hello
16         }
17     }
18 </script>