vue 组件通信 props的使用方式

props的使用方式如下:

一、组件自身的属性对象 --嵌套内外层组件中  负责传递数据 (主要是父级---子级)。

parent----pass props---child

child ---- emit  events ---- parent

二、props:["xx1"]

1、xx1 来自父组件中的类型,已在父组件声明的类型

2、整体的引用位置为子组件

3、使用该内容的位置:子组件,单独一行。

子组件中使用的方式:props:['xx1 : true'] <=>props:['xx1']     xx1直接代表了具体的类型。

猜你喜欢

转载自blog.csdn.net/ColourfulTiger/article/details/81592254