注意要先组册组件 https://www.cnblogs.com/kaibindirver/p/13368830.html

一、父组件传值给子组件的方法

父组件

v-bind:users 可以简写为 :users

属性传值props (组件传值)

 

子组件

属性传值props (组件传值)

 

接受父组件的另外一种写法

props:{
users:{
  type:Array,
  required:true
}
}

 

二、子组件传给父组件

子组件  (阿兰说v-on 可以用@替代)

属性传值props (组件传值)

 

 

 

 父组件

属性传值props (组件传值)

 

 属性传值props (组件传值)

 

$emit

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-01
  • 2021-09-17
  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-21
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
相关资源
相似解决方案