成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁技術文章
文章詳情頁

vue props 一次傳多個值實例

瀏覽:48日期:2022-12-30 13:45:59

數組:

<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 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:{} } },

父組件:

<!-- 選擇內容 --> <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
相關文章: