inleft
2022-08-26 87317f44d9cc20ad70b6971168667e1c843e03d8
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>