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