当前位置:网站首页>Pass parent component to child component: props
Pass parent component to child component: props
2022-07-07 07:09:00 【To be a woman of light】
One 、 Communication between parent components is very common in development , For example, the parent component has some data , Sub components are required for presentation ;
- At this time we can adopt props To complete the communication between components ;
Two 、 What is? Props Well ?
- Props Yes, you can on the component Register some custom attribute;
- Parent component to these attribute assignment , Subcomponent pass attribute Get the corresponding value from the name of ;
3、 ... and 、Props There are two common uses :
- Mode one : Array of strings , The string in the array is attribute The name of ;
- Mode two : object type , The object type can be specified in attribute Name at the same time , Specify the type it passes , Is it necessary 、 Default value and so on ;
Mode one : Dynamic data should be colon

Mode two :

边栏推荐
- Multidisciplinary integration
- Leetcode T1165: 日志分析
- 选择商品属性弹框从底部弹出动画效果
- Databinding exception of kotlin
- Big coffee gathering | nextarch foundation cloud development meetup is coming
- 服装门店如何盈利?
- SolidWorks GB Library (steel profile library, including aluminum profile, aluminum tube and other structures) installation and use tutorial (generating aluminum profile as an example)
- LC 面试题 02.07. 链表相交 & LC142. 环形链表II
- Jetpack Compose 远不止是一个UI框架这么简单~
- How can gyms improve their competitiveness?
猜你喜欢

Config分布式配置中心

Data of all class a scenic spots in China in 2022 (13604)

MOS管参数μCox得到的一种方法

How to do sports training in venues?

Anr principle and Practice

关于数据库数据转移的问题,求各位解答下

Comment les entreprises gèrent - elles les données? Partager les leçons tirées des quatre aspects de la gouvernance des données

组件的嵌套和拆分

IP address

Complete process of MySQL SQL
随机推荐
. Net core accesses uncommon static file types (MIME types)
AddressSanitizer 技术初体验
Tujia, muniao, meituan... Home stay summer war will start
子组件传递给父组件
Abnova circulating tumor DNA whole blood isolation, genomic DNA extraction and analysis
MATLAB小技巧(30)非线性拟合 lsqcurefit
oracle如何备份索引
Jetpack Compose 远不止是一个UI框架这么简单~
算法---比特位计数(Kotlin)
leetcode 509. Fibonacci number
Master-slave replication principle of MySQL
Bus消息总线
组件的嵌套和拆分
How to share the same storage among multiple kubernetes clusters
栈题目:有效括号的嵌套深度
Common function detect_ image/predict
ViewModelProvider. Of obsolete solution
Release notes of JMeter version 5.5
How does an enterprise manage data? Share the experience summary of four aspects of data governance
华为机试题素数伴侣