inleft
2022-03-07 a529ff7c29ab498b35b0f57ae88bc1b2e4525919
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>