vue props 一次傳多個(gè)值實(shí)例
數(shù)組:
<custom-element :whatever='[...array]'></custom-element>
對(duì)象:
<custom-element :whatever='{...obj}'></custom-element>
或者:
<custom-element v-bind='obj' </custom-element>
子組件:
<ul class='car_wrap'> <li > <span> <i aria-hidden='true'></i> </span> <p>{{propsText.seleTime}}</p> </li> <li class='car_start'> <span> <i aria-hidden='true'></i> </span> <p>{{propsText.carsStart}}</p> </li> <li class='car_end'> <span> <i aria-hidden='true'></i> </span> <p>{{propsText.carEnd}}</p> </li> <li class='remark'> <span> <i aria-hidden='true'></i> </span> <p>{{propsText.Remark}}</p> </li> </ul> <div class='confirmation_car'> props: { propsText:{ type: Object, default:{} } },
父組件:
<!-- 選擇內(nèi)容 --> <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 } };
補(bǔ)充知識(shí):vue props 屬性值接受多個(gè)類(lèi)型
我就廢話不多說(shuō)了,大家還是直接看代碼吧~
originalData: { type: Array | Object, default () { return [] } } } ```
以上這篇vue props 一次傳多個(gè)值實(shí)例就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持好吧啦網(wǎng)。
相關(guān)文章:
1. javascript xml xsl取值及數(shù)據(jù)修改第1/2頁(yè)2. HTML5 Canvas繪制圖形從入門(mén)到精通3. jsp+servlet簡(jiǎn)單實(shí)現(xiàn)上傳文件功能(保存目錄改進(jìn))4. css代碼優(yōu)化的12個(gè)技巧5. JavaWeb Servlet中url-pattern的使用6. 詳解瀏覽器的緩存機(jī)制7. asp知識(shí)整理筆記4(問(wèn)答模式)8. XML入門(mén)的常見(jiàn)問(wèn)題(一)9. asp批量添加修改刪除操作示例代碼10. 微信開(kāi)發(fā) 網(wǎng)頁(yè)授權(quán)獲取用戶(hù)基本信息
