当前位置:网站首页>父组件传递给子组件:Props
父组件传递给子组件:Props
2022-07-07 03:12:00 【要成为光的女人】
一、在开发中很常见的就是父组件之间通信,比如父组件有一些数据,需要子组件进行展示;
- 这个时候我们可以通过props来完成组件之间的通信;
二、什么是Props呢?
- Props是你可以在组件上注册一些自定义的attribute;
- 父组件给这些attribute赋值,子组件通过attribute的名称获取到对应的值;
三、Props有两种常见的用法:
- 方式一:字符串数组,数组中的字符串就是attribute的名称;
- 方式二:对象类型,对象类型可以在指定attribute名称的同时,指定它传递的类型,是否是必须的、默认值等等;
方式一:动态数据要加冒号

方式二:

边栏推荐
- oracle如何备份索引
- Installing redis and windows extension method under win system
- sqlserver多线程查询问题
- 循环肿瘤细胞——Abnova 解决方案来啦
- Jmeter 5.5版本发布说明
- Under what circumstances should we consider sub database and sub table
- How Oracle backs up indexes
- Prime partner of Huawei machine test questions
- 2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书
- 品牌·咨询标准化
猜你喜欢

Graduation design game mall

Prompt for channel security on the super-v / device defender side when installing vmmare
![Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]](/img/13/096857158c9f977f8677f7cd0f9d4b.png)
Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]

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

Please answer the questions about database data transfer

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

品牌电商如何逆势增长?在这里预见未来!

品牌·咨询标准化

Prime partner of Huawei machine test questions

How can brand e-commerce grow against the trend? See the future here!
随机推荐
How to model and simulate the target robot [mathematical / control significance]
RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`问题解决
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书
Leetcode T1165: 日志分析
Please tell me how to monitor multiple schemas and tables by listening to PgSQL
2022年全国所有A级景区数据(13604条)
请问 flinksql对接cdc时 如何实现计算某个字段update前后的差异 ?
如何给目标机器人建模并仿真【数学/控制意义】
A slow SQL drags the whole system down
Algorithm --- bit count (kotlin)
LC 面试题 02.07. 链表相交 & LC142. 环形链表II
请教一下,监听pgsql ,怎样可以监听多个schema和table
华为机试题素数伴侣
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书第二阶段答案
String (explanation)
Libcurl returns curlcode description
多线程与高并发(9)——AQS其他同步组件(Semaphore、ReentrantReadWriteLock、Exchanger)
【JDBC以及内部类的讲解】
libcurl返回curlcode说明
使用TCP/IP四层模型进行网络传输的基本流程