1.声明一个组件  chila.vue

<template> <div> child1 //显示内容 </div> </template> <script> export default { name: "child1" } </script>

  

1


2.引用 parent.vue



<template> <div> <child1 ref="child1"></child1> //使用 </div> </template> <script> import Child1 from './child1'; //引用 export default { name: "parent", components: {child1: Child1} } </script>

  

 

相关文章:

  • 2021-06-19
  • 2021-06-27
  • 2022-01-14
  • 2022-12-23
  • 2022-01-07
  • 2021-12-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-30
  • 2021-11-21
  • 2022-12-23
  • 2022-01-07
相关资源
相似解决方案