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

方式二:

边栏推荐
- Prime partner of Huawei machine test questions
- Test of transform parameters of impdp
- FPGA课程:JESD204B的应用场景(干货分享)
- Sword finger offer high quality code
- MySql用户权限
- 2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书第一阶段答案
- 品牌·咨询标准化
- Installing redis and windows extension method under win system
- How to share the same storage among multiple kubernetes clusters
- Please answer the questions about database data transfer
猜你喜欢

Complete process of MySQL SQL

. Net core accesses uncommon static file types (MIME types)

Use of completable future
![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]

Take you to brush (niuke.com) C language hundred questions (the first day)

毕业设计游戏商城

Jetpack compose is much more than a UI framework~

.net core 访问不常见的静态文件类型(MIME 类型)

学术报告系列(六) - Autonomous Driving on the journey to full autonomy

JESD204B时钟网络
随机推荐
Mysql---- import and export & View & Index & execution plan
请教一个问题,flink oracle cdc,读取一个没有更新操作的表,隔十几秒就重复读取全量数据
Several index utilization of joint index ABC
Leetcode t1165: log analysis
LC 面试题 02.07. 链表相交 & LC142. 环形链表II
RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`问题解决
Brand · consultation standardization
How can gyms improve their competitiveness?
Maze games based on JS
精准时空行程流调系统—基于UWB超高精度定位系统
Matlab tips (30) nonlinear fitting lsqcurefit
Multidisciplinary integration
Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]
什么情况下考虑分库分表
数据资产管理与数据安全国内外最新趋势
请问 flinksql对接cdc时 如何实现计算某个字段update前后的差异 ?
How to share the same storage among multiple kubernetes clusters
品牌·咨询标准化
Please tell me how to monitor multiple schemas and tables by listening to PgSQL
MySql用户权限