数组:
<custom-element :whatever="[...array]"></custom-element>
对象:
<custom-element :whatever="{...obj}"></custom-element>
或者:
<custom-element v-bind="obj" </custom-element>
子组件:
<ul class="car_wrap"> <li > <span> <i class="fa fa-clock-o clock_icon" aria-hidden="true"></i> </span> <p>{{propsText.seleTime}}</p> </li> <li class="car_start"> <span> <i class="fa fa-circle circle_icon" aria-hidden="true"></i> </span> <p>{{propsText.carsStart}}</p> </li> <li class="car_end"> <span> <i class="fa fa-circle circle_icon" aria-hidden="true"></i> </span> <p>{{propsText.carEnd}}</p> </li> <li class="remark"> <span> <i class="fa fa-circle circle_icon" aria-hidden="true"></i> </span> <p>{{propsText.Remark}}</p> </li> </ul> <div class="confirmation_car"> props: { propsText:{ type: Object, default:{} } },
父组件:
<!-- 选择内容 --> <div class="select_content"> <app-footer-car :clock="clock" :propsText="{...propsText}"/> </div> import appFooterCar from "../FooterCarList/FooterCarList"; data() { return { propsText:{ seleTime:11, carsStart:22, carEnd:33, Remark:44, confirmationCar:55 } };
补充知识:vue props 属性值接受多个类型
我就废话不多说了,大家还是直接看代码吧~
originalData: { type: Array | Object, default () { return [] } } } ```
以上这篇vue props 一次传多个值实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
标签:
vue,props传值
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
暂无“vue props 一次传多个值实例”评论...
更新动态
2024年04月29日
2024年04月29日
- 物华弥新迷踪盘第1关怎么过 迷踪盘第1关通关方法
- win7没密钥怎么永久激活,w7系统激活密钥一键激活方法
- 怎么安装电脑系统版本,怎么安装电脑的系统
- 苹果电脑wps安装字体,苹果电脑wps怎么设置字体
- 活力美少女!《摇曳露营△》各务原抚子&志摩凛手办
- 《哥斯拉大战金刚2》票房破9亿 观影人次达2100万!
- 全新IP!《寂静岭2:重制版》开发商正在开发两款新作
- FlorilegiumandAshleySolomon-Haydn-SymphoniesNos.6,7,8LeMatin,Lemidi,LeSoir[flac]
- [PTC5186211]花痴系列-柏辽兹-幻想交响曲,Op.14-小泽征尔-波士顿交响乐团iso
- 欧阳菲菲-爱的路上我和你[东尼机构TONYLP-71LP黑胶转录]1977WAV+CUE
- 玩家确认《剑星》实体版可玩未审核版本:需断网安装
- 用火力战胜恐惧!《Backrooms Break》现已正式上线
- 晨报|《庄园领主》销量破百万 塔科夫PVE正式版将免费
- 冯天石《飞叶穿林——冯天石竹笛演奏专辑》[320K/MP3][92.25MB]
- 冯天石《飞叶穿林——冯天石竹笛演奏专辑》[FLAC/分轨][208.98MB]