- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前在使用 React 解析一些 JSON 数据时遇到问题。这是我尝试使用的 JSON 数据:
[
{
"id": 3,
"car_brand_id": 2,
"car_model_id": 7,
"youtube": "",
"title": "New Ibiza range available in Sunderland & Durham - Pulman SEAT ",
"description": "Buy a new Ibiza from Pulman SEAT - Available to test drive in Sunderland & Durham",
"slug": "ibiza",
"published": 1,
"news": 0,
"published_at": "2016-07-05 09:16:04",
"created_at": "2016-05-23 12:45:20",
"updated_at": "2016-07-05 13:16:04",
"offers": [
{
"id": 9,
"car_page_id": 3,
"car_trim_id": 15,
"car_type_id": 1,
"cap_code_id": 0,
"car_image_id": 70,
"derivative": "SC 1.2 TSI 90PS ",
"car_position_id": 6,
"youtube_code": "XDKSBXbIXV0",
"terms": "This offer is for the from Pulman SEAT is based on PCP (personal contract plan). Valid for retail customers only. Vehicles to be registered and delivered before 30/09/16. Offer can be withdrawn at any time. It can also be extended. No other offers may be used in conjunction with the above detailed offer. At the beginning of the plan SEAT Financial services is the legal owner and provider of this PCP. At the end of the agreement there are 3 options: (i) Renew: Part exchange the vehicle (ii) Retain: Pay the Optional Final Payment to own the vehicle or (iii) Return the vehicle. *Payable with first payment. ** Payable with optional final payment. #4.4p per mile excess mileage charges apply. Further charges may be payable if vehicle is returned. Indemnities may be required. Subject to status. Available to over 18s in the UK only. Offer is subject to vehicle availability and may be varied or withdrawn at any time. Certain vehicles excluded- ask for full details. Finance providers may pay us for introducing you to them. We can introduce you to a limited number of lenders to assist with your purchase, who may pay us for introducing you to them. † £2,500 deposit contribution available on Ibiza SC FR 1.2 TSI 90PS when purchased on SEAT Solutions. ^ £671 Saving based on RRP. Images for illustration purposes only. ^^ One year’s insurance included at no extra cost from SEAT Insurance is available on all qualifying new Ibiza FR models only ordered from 1st July 2016 to 30th September 2016 and registered by 10th January 2017 for drivers 18 and over. Drivers under 18 are not eligible. May exclude Northern Ireland. Drivers aged 18-24 are required to share their driving style data with a telematics product. Available on Ibiza FR trim only. Other eligibility criteria apply. Go to www.seat.co.uk/free-insurance-offer for full terms and conditions. This offer may be extended, changed or removed at any point. SEAT Motor Insurance from SEAT Financial Services is arranged and administered by Carrot Risk Technologies Limited.",
"status": 1,
"created_at": "2016-07-04 15:08:03",
"updated_at": "2016-07-19 14:03:46",
"image": {
"id": 70,
"car_image_category_id": 7,
"image_name": "Ibiza-FR-SC-Insurance",
"name": "aa093fb987a0898588daa8825f90001443afc68d.png",
"path": "img/imagedb/aa093fb987a0898588daa8825f90001443afc68d.png",
"thumbnail_path": "img/imagedb/thumbs/tn-aa093fb987a0898588daa8825f90001443afc68d.png",
"created_at": "2016-07-05 09:35:09",
"updated_at": "2016-07-05 09:35:09"
},
"trim": {
"id": 15,
"car_model_id": 7,
"name": "FR",
"created_at": "2016-06-08 10:07:45",
"updated_at": "2016-06-08 10:07:45"
}
}
],
"model": {
"id": 7,
"brand_id": 2,
"name": "Ibiza",
"created_at": "2016-05-23 12:44:29",
"updated_at": "2016-05-23 12:44:29"
}
},
{
"id": 6,
"car_brand_id": 2,
"car_model_id": 13,
"youtube": "",
"title": "New Mii range available in Sunderland & Durham - Pulman SEAT ",
"description": "Buy a new Mii from Pulman SEAT - Available to test drive in Sunderland & Durham",
"slug": "mii",
"published": 1,
"news": 0,
"published_at": "2016-07-05 05:51:57",
"created_at": "2016-06-08 10:57:52",
"updated_at": "2016-07-05 09:51:57",
"offers": [
{
"id": 6,
"car_page_id": 6,
"car_trim_id": 21,
"car_type_id": 1,
"cap_code_id": null,
"car_image_id": 60,
"derivative": "3DR 1.0 60PS",
"car_position_id": 2,
"youtube_code": "",
"terms": "At the end of the agreement there are three options: I) retain the vehicle: pay the optional final payment to own the vehicle; ii) return the vehicle; or iii) replace: part exchange the vehicle, subject to status. Available when purchased on Solutions Personal Contract Plan ordered until 30th September 2016. *Payable with first payment. ** Payable with optional final payment. Retail sales only. #4.4p per mile excess mileage charges apply. Further charges may be payable if vehicle is returned. Indemnities may be required. Subject to status. Available to over 18s in the UK only. Offer is subject to vehicle availability and may be varied or withdrawn at any time. † £1,800 deposit contribution available on Mii Design 1.0 3DR when purchased on SEAT Solutions. Finance providers may pay us for introducing you to them. We can introduce you to a limited number of lenders to assist with your purchase, who may pay us for introducing you to them. **Pulman SEAT price match guarantee is available on like for like new SEAT models with identical spec. A genuine quote must be provided within a 15-mile radius. images for illustration purposes only",
"status": 1,
"created_at": "2016-06-15 08:41:56",
"updated_at": "2016-07-04 22:15:25",
"image": {
"id": 60,
"car_image_category_id": 11,
"image_name": "Mii-Design",
"name": "dbecbdbc29234053e0bf8a09968ad991e7a17492.png",
"path": "img/imagedb/dbecbdbc29234053e0bf8a09968ad991e7a17492.png",
"thumbnail_path": "img/imagedb/thumbs/tn-dbecbdbc29234053e0bf8a09968ad991e7a17492.png",
"created_at": "2016-07-04 12:34:07",
"updated_at": "2016-07-04 12:34:07"
},
"trim": {
"id": 21,
"car_model_id": 13,
"name": "Design",
"created_at": "2016-06-14 09:17:10",
"updated_at": "2016-06-14 09:17:10"
}
}
],
"model": {
"id": 13,
"brand_id": 2,
"name": "Mii",
"created_at": "2016-06-08 10:54:21",
"updated_at": "2016-06-08 10:54:21"
}
},
{
"id": 8,
"car_brand_id": 2,
"car_model_id": 11,
"youtube": "",
"title": "New SEAT Leon range available in Sunderland & Durham - Pulman SEAT ",
"description": "Buy a new SEAT Leon from Pulman SEAT - Available to test drive in Sunderland & Durham",
"slug": "leon",
"published": 1,
"news": 0,
"published_at": "2016-07-05 05:53:33",
"created_at": "2016-07-04 08:38:32",
"updated_at": "2016-07-05 09:53:33",
"offers": [
{
"id": 21,
"car_page_id": 8,
"car_trim_id": 35,
"car_type_id": 1,
"cap_code_id": null,
"car_image_id": 50,
"derivative": "5DR 1.2 TSI 110PS",
"car_position_id": 19,
"youtube_code": "",
"terms": "At the end of the agreement there are three options: i) retain the vehicle: pay the optional final payment to own the vehicle; ii) return the vehicle; or iii) replace: part exchange the vehicle, subject to status. Available when purchased on Solutions Personal Contract Plan until 30th September 2016. Retail sales only. *Payable with first payment. ** Payable with optional final payment. #7.2p per mile excess mileage charges apply. Further charges may be payable if vehicle is returned. Indemnities may be required. Subject to status. Available to over 18s in the UK only. Offer is subject to vehicle availability and may be varied or withdrawn at any time. Certain vehicles excluded- ask for full details. † £2,000 deposit contributions available when purchased on SEAT Personal Contract Plan. Retail Sales Only. Finance providers may pay us for introducing you to them. We can introduce you to a limited number of lenders to assist with your purchase, who may pay us for introducing you to them. Images for illustrative purposes only. ",
"status": 1,
"created_at": "2016-07-05 08:29:28",
"updated_at": "2016-07-19 14:03:46",
"image": {
"id": 50,
"car_image_category_id": 12,
"image_name": "Leon-SE-5DR",
"name": "184484219879badbb5dab51b7421203c2bc16fa0.png",
"path": "img/imagedb/184484219879badbb5dab51b7421203c2bc16fa0.png",
"thumbnail_path": "img/imagedb/thumbs/tn-184484219879badbb5dab51b7421203c2bc16fa0.png",
"created_at": "2016-07-04 12:25:48",
"updated_at": "2016-07-04 12:25:48"
},
"trim": {
"id": 35,
"car_model_id": 11,
"name": "SE Dynamic",
"created_at": "2016-06-14 09:51:20",
"updated_at": "2016-06-14 09:51:20"
}
}
],
"model": {
"id": 11,
"brand_id": 2,
"name": "Leon",
"created_at": "2016-06-08 10:06:29",
"updated_at": "2016-06-08 10:06:29"
}
},
{
"id": 9,
"car_brand_id": 2,
"car_model_id": 14,
"youtube": "",
"title": "Lorem",
"description": "Lorem",
"slug": "ibiza-st",
"published": 0,
"news": 0,
"published_at": "2016-07-04 11:38:48",
"created_at": "2016-07-04 13:05:29",
"updated_at": "2016-07-04 15:38:48",
"offers": [],
"model": {
"id": 14,
"brand_id": 2,
"name": "Ibiza ST",
"created_at": "2016-06-08 10:54:53",
"updated_at": "2016-06-08 10:54:53"
}
},
{
"id": 10,
"car_brand_id": 2,
"car_model_id": 15,
"youtube": "",
"title": "New Leon ST range available in Sunderland & Durham - Pulman SEAT ",
"description": "Buy a new SEAT Leon ST from Pulman SEAT - Available to test drive in Sunderland & Durham",
"slug": "leon-st",
"published": 1,
"news": 0,
"published_at": "2016-07-05 05:54:09",
"created_at": "2016-07-04 13:23:23",
"updated_at": "2016-07-05 09:54:09",
"offers": [
{
"id": 22,
"car_page_id": 10,
"car_trim_id": 48,
"car_type_id": 1,
"cap_code_id": null,
"car_image_id": 53,
"derivative": "5DR 1.2 TSI 110PS",
"car_position_id": 23,
"youtube_code": "",
"terms": "At the end of the agreement there are three options: i) retain the vehicle: pay the optional final payment to own the vehicle; ii) return the vehicle; or iii) replace: part exchange the vehicle, subject to status. Available when purchased on Solutions Personal Contract Plan until 30th September 2016. Retail sales only. *Payable with first payment. ** Payable with optional final payment. #7.2p per mile excess mileage charges apply. Further charges may be payable if vehicle is returned. Indemnities may be required. Subject to status. Available to over 18s in the UK only. Offer is subject to vehicle availability and may be varied or withdrawn at any time. Certain vehicles excluded- ask for full details. † £2,000 deposit contributions available when purchased on SEAT Personal Contract Plan. Retail Sales Only. Finance providers may pay us for introducing you to them. We can introduce you to a limited number of lenders to assist with your purchase, who may pay us for introducing you to them. Images for illustrative purposes only.",
"status": 1,
"created_at": "2016-07-05 08:38:51",
"updated_at": "2016-07-19 14:15:41",
"image": {
"id": 53,
"car_image_category_id": 12,
"image_name": "Leon-ST-SE",
"name": "c743dc09fc1b24c1fac866baf6e3fe3f98f3e6af.png",
"path": "img/imagedb/c743dc09fc1b24c1fac866baf6e3fe3f98f3e6af.png",
"thumbnail_path": "img/imagedb/thumbs/tn-c743dc09fc1b24c1fac866baf6e3fe3f98f3e6af.png",
"created_at": "2016-07-04 12:25:49",
"updated_at": "2016-07-04 12:25:49"
},
"trim": {
"id": 48,
"car_model_id": 15,
"name": "SE Dynamic",
"created_at": "2016-06-14 10:39:16",
"updated_at": "2016-06-14 10:39:16"
}
}
],
"model": {
"id": 15,
"brand_id": 2,
"name": "Leon ST",
"created_at": "2016-06-08 10:55:21",
"updated_at": "2016-06-08 10:55:21"
}
},
{
"id": 11,
"car_brand_id": 2,
"car_model_id": 16,
"youtube": "",
"title": " New SEAT Leon Cupra range available in Sunderland - Pulman SEAT ",
"description": "Buy a new SEAT Leon Cupra from Pulman SEAT - Available to test drive in Sunderland & Durham",
"slug": "leon-cupra",
"published": 1,
"news": 0,
"published_at": "2016-07-05 05:55:06",
"created_at": "2016-07-04 13:27:04",
"updated_at": "2016-07-05 09:55:06",
"offers": [
{
"id": 11,
"car_page_id": 11,
"car_trim_id": 39,
"car_type_id": 1,
"cap_code_id": null,
"car_image_id": 67,
"derivative": "SC 2.0 TSI 290PS ",
"car_position_id": 11,
"youtube_code": "",
"terms": "At the end of the agreement there are three options: I) retain the vehicle: pay the optional final payment to own the vehicle; ii) return the vehicle; or iii) replace: part exchange the vehicle, subject to status. Available when purchased on Solutions Personal Contract Plan on vehicles ordered until 30th September 2016. Retail sales only. *Payable with first payment. ** Payable with optional final payment. #7.2p per mile excess mileage charges apply. Further charges may be payable if vehicle is returned. Indemnities may be required. Subject to status. Available to over 18s in the UK only. Offer is subject to vehicle availability and may be varied or withdrawn at any time. Certain vehicles excluded- ask for full details. † £2,500 deposit contribution available when purchased with SEAT finance. * Finance providers may pay us for introducing you to them. We can introduce you to a limited number of lenders to assist with your purchase, who may pay us for introducing you to them. Images for illustrative purposes only. Images for illustration purposes only.",
"status": 1,
"created_at": "2016-07-04 15:39:03",
"updated_at": "2016-07-19 14:03:46",
"image": {
"id": 67,
"car_image_category_id": 16,
"image_name": "Leon-Cupra",
"name": "860d4b8e32224ccabe5cf4c2b78424b0fccbf0ea.png",
"path": "img/imagedb/860d4b8e32224ccabe5cf4c2b78424b0fccbf0ea.png",
"thumbnail_path": "img/imagedb/thumbs/tn-860d4b8e32224ccabe5cf4c2b78424b0fccbf0ea.png",
"created_at": "2016-07-05 09:22:40",
"updated_at": "2016-07-05 09:22:40"
},
"trim": {
"id": 39,
"car_model_id": 16,
"name": "290",
"created_at": "2016-06-14 10:16:19",
"updated_at": "2016-06-14 10:16:19"
}
}
],
"model": {
"id": 16,
"brand_id": 2,
"name": "Leon Cupra",
"created_at": "2016-06-08 10:55:28",
"updated_at": "2016-06-08 10:55:28"
}
},
{
"id": 12,
"car_brand_id": 2,
"car_model_id": 17,
"youtube": "",
"title": " New SEAT Leon X-PERIENCE range available in Sunderland - Pulman SEAT ",
"description": "Buy a new SEAT Leon X-PERIENCE from Pulman SEAT - Available to test drive in Sunderland & Durham",
"slug": "leon-x-perience",
"published": 1,
"news": 0,
"published_at": "2016-07-05 05:56:46",
"created_at": "2016-07-04 13:40:32",
"updated_at": "2016-07-05 09:56:46",
"offers": [
{
"id": 23,
"car_page_id": 12,
"car_trim_id": 37,
"car_type_id": 1,
"cap_code_id": 175,
"car_image_id": 54,
"derivative": "2.0 TDI 150PS",
"car_position_id": 24,
"youtube_code": "",
"terms": "At the end of the agreement there are three options: i) retain the vehicle: pay the optional final payment to own the vehicle; ii) return the vehicle; or iii) replace: part exchange the vehicle, subject to status. Available when purchased on Solutions Personal Contract Plan until 30th September 2016. Retail sales only. *Payable with first payment. ** Payable with optional final payment. #7.2p per mile excess mileage charges apply. Further charges may be payable if vehicle is returned. Indemnities may be required. Subject to status. Available to over 18s in the UK only. Offer is subject to vehicle availability and may be varied or withdrawn at any time. Certain vehicles excluded- ask for full details. † £2,000 deposit contributions available when purchased on SEAT Personal Contract Plan. Retail Sales Only. Finance providers may pay us for introducing you to them. We can introduce you to a limited number of lenders to assist with your purchase, who may pay us for introducing you to them. Images for illustrative purposes only. ^^ This information should be used for illustration purposes only. Standard EU Test figures for comparison purposes, may not reflect real driving results.",
"status": 1,
"created_at": "2016-07-05 09:43:11",
"updated_at": "2016-07-19 14:15:41",
"image": {
"id": 54,
"car_image_category_id": 12,
"image_name": "Leon-X-Perience",
"name": "e3e791f870ef57ade77d1f04436d423ac9ae5755.png",
"path": "img/imagedb/e3e791f870ef57ade77d1f04436d423ac9ae5755.png",
"thumbnail_path": "img/imagedb/thumbs/tn-e3e791f870ef57ade77d1f04436d423ac9ae5755.png",
"created_at": "2016-07-04 12:25:50",
"updated_at": "2016-07-04 12:25:50"
},
"trim": {
"id": 37,
"car_model_id": 17,
"name": "SE",
"created_at": "2016-06-14 10:11:43",
"updated_at": "2016-06-14 10:11:43"
}
}
],
"model": {
"id": 17,
"brand_id": 2,
"name": "Leon X-PERIENCE",
"created_at": "2016-06-08 10:55:54",
"updated_at": "2016-06-08 10:55:54"
}
},
{
"id": 13,
"car_brand_id": 2,
"car_model_id": 18,
"youtube": "",
"title": "New SEAT Toledo range available in Sunderland - Pulman SEAT ",
"description": "Buy a new SEAT Toledo from Pulman SEAT - Available to test drive in Sunderland & Durham",
"slug": "toledo",
"published": 1,
"news": 0,
"published_at": "2016-07-05 05:56:34",
"created_at": "2016-07-04 13:40:48",
"updated_at": "2016-07-05 09:56:34",
"offers": [
{
"id": 19,
"car_page_id": 13,
"car_trim_id": 50,
"car_type_id": 1,
"cap_code_id": 197,
"car_image_id": 63,
"derivative": "1.4 TDI Ecomotive SE",
"car_position_id": 18,
"youtube_code": "",
"terms": "At the end of the agreement there are three options: I) retain the vehicle: pay the optional final payment to own the vehicle; ii) return the vehicle; or iii) replace: part exchange the vehicle, subject to status. Available when purchased on Solutions Personal Contract Plan on vehicles ordered until 30th September 2016. Retail sales only. *Payable with first payment. ** Payable with optional final payment. #7.2p per mile excess mileage charges apply. Further charges may be payable if vehicle is returned. Indemnities may be required. Subject to status. Available to over 18s in the UK only. Offer is subject to vehicle availability and may be varied or withdrawn at any time. Certain vehicles excluded- ask for full details. † £3,250 deposit contribution available on when purchased on SEAT Solutions. Finance providers may pay us for introducing you to them. We can introduce you to a limited number of lenders to assist with your purchase, who may pay us for introducing you to them. Images for illustrative purposes only. ^^ This information should be used for illustration purposes only. Standard EU Test figures for comparison purposes, may not reflect real driving results.",
"status": 1,
"created_at": "2016-07-05 08:17:55",
"updated_at": "2016-07-19 14:03:46",
"image": {
"id": 63,
"car_image_category_id": 14,
"image_name": "Toledo-Style-Advanced",
"name": "f2ba78e24b7f9286e5c4b37da716e491a99f2d23.png",
"path": "img/imagedb/f2ba78e24b7f9286e5c4b37da716e491a99f2d23.png",
"thumbnail_path": "img/imagedb/thumbs/tn-f2ba78e24b7f9286e5c4b37da716e491a99f2d23.png",
"created_at": "2016-07-04 12:41:54",
"updated_at": "2016-07-04 12:41:54"
},
"trim": {
"id": 50,
"car_model_id": 18,
"name": "SE",
"created_at": "2016-06-14 10:49:09",
"updated_at": "2016-06-14 10:49:09"
}
}
],
"model": {
"id": 18,
"brand_id": 2,
"name": "Toledo",
"created_at": "2016-06-08 10:56:11",
"updated_at": "2016-06-08 10:56:11"
}
},
{
"id": 14,
"car_brand_id": 2,
"car_model_id": 19,
"youtube": "",
"title": "New SEAT Alhambra range available in Sunderland - Pulman SEAT ",
"description": "Buy a new SEAT Alhambra from Pulman SEAT - Available to test drive in Sunderland & Durham",
"slug": "alhambra",
"published": 1,
"news": 0,
"published_at": "2016-07-05 05:57:49",
"created_at": "2016-07-04 13:41:03",
"updated_at": "2016-07-05 09:57:49",
"offers": [
{
"id": 15,
"car_page_id": 14,
"car_trim_id": 54,
"car_type_id": 1,
"cap_code_id": 3,
"car_image_id": 64,
"derivative": "2.0 TDI CR 150PS ",
"car_position_id": 14,
"youtube_code": "",
"terms": "At the end of the agreement there are three options: I) retain the vehicle: pay the optional final payment to own the vehicle; ii) return the vehicle; or iii) replace: part exchange the vehicle, subject to status. Available when purchased on Solutions Personal Contract Plan. Retail sales only. Offer available for vehicles ordered before 30th September 2016. *Payable with first payment. ** Payable with optional final payment. #7.2p per mile excess mileage charges apply. Further charges may be payable if vehicle is returned. Indemnities may be required. Subject to status. Available to over 18s in the UK only. Offer is subject to vehicle availability and may be varied or withdrawn at any time. Certain vehicles excluded- ask for full details. † £2,000 deposit contribution available on SEAT Alhambra when purchased on SEAT Solutions. Finance providers may pay us for introducing you to them. We can introduce you to a limited number of lenders to assist with your purchase, who may pay us for introducing you to them. ^^ This information should be used for illustration purposes only. Standard EU Test figures for comparison purposes, may not reflect real driving results. Images for illustrative purposes only.",
"status": 1,
"created_at": "2016-07-04 15:55:00",
"updated_at": "2016-07-19 14:03:46",
"image": {
"id": 64,
"car_image_category_id": 15,
"image_name": "Alhambra",
"name": "d6a0039805cdb91732992799ef0d52892767a36b.png",
"path": "img/imagedb/d6a0039805cdb91732992799ef0d52892767a36b.png",
"thumbnail_path": "img/imagedb/thumbs/tn-d6a0039805cdb91732992799ef0d52892767a36b.png",
"created_at": "2016-07-04 12:44:19",
"updated_at": "2016-07-04 12:44:19"
},
"trim": {
"id": 54,
"car_model_id": 19,
"name": "SE",
"created_at": "2016-06-14 10:55:55",
"updated_at": "2016-06-14 10:55:55"
}
}
],
"model": {
"id": 19,
"brand_id": 2,
"name": "Alhambra",
"created_at": "2016-06-08 10:56:23",
"updated_at": "2016-06-08 10:56:23"
}
},
{
"id": 15,
"car_brand_id": 2,
"car_model_id": 20,
"youtube": "mJTPmbuxwqQ",
"title": "New ATECA range available in Sunderland & Durham - Pulman SEAT ",
"description": "Buy a new SEAT ATECA from Pulman SEAT - Available to test drive in Sunderland & Durham",
"slug": "ateca",
"published": 1,
"news": 0,
"published_at": "2016-07-07 08:22:04",
"created_at": "2016-07-07 09:16:52",
"updated_at": "2016-07-07 12:22:04",
"offers": [
{
"id": 26,
"car_page_id": 15,
"car_trim_id": 62,
"car_type_id": 1,
"cap_code_id": null,
"car_image_id": 80,
"derivative": "1.0 TSI 115PS",
"car_position_id": 25,
"youtube_code": "",
"terms": "At the end of the agreement there are three options: I) retain the vehicle: pay the optional final payment to own the vehicle; ii) return the vehicle; or iii) replace: part exchange the vehicle, subject to status. Available when purchased on Solutions Personal Contract Plan ordered until 30th September 2016. *Payable with first payment. ** Payable with optional final payment. Retail sales only. #4.4p per mile excess mileage charges apply. Further charges may be payable if vehicle is returned. Indemnities may be required. Subject to status. Available to over 18s in the UK only. Offer is subject to vehicle availability and may be varied or withdrawn at any time. Finance providers may pay us for introducing you to them. We can introduce you to a limited number of lenders to assist with your purchase, who may pay us for introducing you to them. ",
"status": 1,
"created_at": "2016-07-07 12:13:50",
"updated_at": "2016-07-19 14:15:41",
"image": {
"id": 80,
"car_image_category_id": 17,
"image_name": "Ateca-First",
"name": "df14d12b1016b885cf63a47900886322d1c189f9.png",
"path": "img/imagedb/df14d12b1016b885cf63a47900886322d1c189f9.png",
"thumbnail_path": "img/imagedb/thumbs/tn-df14d12b1016b885cf63a47900886322d1c189f9.png",
"created_at": "2016-07-07 09:44:21",
"updated_at": "2016-07-07 09:44:21"
},
"trim": {
"id": 62,
"car_model_id": 20,
"name": "First Edition",
"created_at": "2016-07-07 09:06:31",
"updated_at": "2016-07-07 09:06:31"
}
}
],
"model": {
"id": 20,
"brand_id": 2,
"name": "Ateca",
"created_at": "2016-07-07 09:04:36",
"updated_at": "2016-07-07 09:04:36"
}
}
]
我可以使用大部分数据,但是当我尝试访问 "offers"
数组中的对象时,它不会提取任何数据。
目前我可以像这样将数据拉入我的组件:
{props.vehicle.model.name}
但是,如果我尝试像这样从数组中提取数据:
{props.vehicle.offers.derivative}
没有数据被拉到前端,知道如何访问该数据吗?
谢谢,尼克
最佳答案
offers
是 Objects
的 Array
,首先你需要通过索引获取 Array
元素,然后获取 对象的
属性
props.vehicle.offers[0].derivative
更新
你得到这个错误(TypeError: Cannot read property 'derivative' of undefined
)因为你有 offers
为空的数据 Array
,例如 { id: 9 }
,offers
为空。如果 offers
为空 Array
offers[0]
返回 undefined
,当您尝试获取属性 .derivative
时它会抛出错误,因为 undefined
没有任何属性。,您可以添加条件来检查 offers
是否包含元素 - Example
关于javascript - 在 ReactJS 中访问数组中的对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38524580/
这是关于非标准属性的。 https://facebook.github.io/react/docs/tags-and-attributes.html 在 react 中我做了这个: React.cr
我制作了 2 个组件:1)内容(使用 fetch() 显示数据)2)分页(共5页,每页16个对象) 我创建了 2 个状态变量,分别称为 start:0 和 end:16。现在,每当用户单击页码时,我都
我们正在使用 ReactJS 创建一个搜索前端。要求是当用户单击文档名称时,该文档必须在嵌入式查看器中打开。有人为此使用过任何 ReactJS 组件吗?否则,我应该使用 JQuery 查看器组件吗?请
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 1 年前。
我现有的项目: 前端框架 - PHP Codeigniter 和 PHP Laravel 后端框架 - JAVA Springboot 我正在尝试将前端框架更改为 ReactJS。我想知道与 Reac
我有一个实现刷新授权 token 的方案。在这种情况下,我为每种操作(发布、获取、删除)实现了一个通用操作,并使用参数调用它们。 export function Get(param) { return
我现在有 { _this.setState({startDate: input})}}/> 无论我一直在改变什么(onChange 部分到 ref 等等),当我 console.log 我的状态时,
我在两个不同的文件中有两个单独的组件 组件A 和 组件B 我在 中有一个按钮组件B 现在我想测试当 中的特定按钮时组件B 被点击,组件A 应呈现如下: import { render, screen,
我有一个包含几个问题的表格。一些问题有一组子问题。 这些是使用以下代码呈现的。 { Object.keys(this.props.moduleDetails.questions).map(
我有两个组件。第一个状态初始化: import React from 'react'; class One extends React.Component { constructor(prop
我的项目是一个对象数组,我只获取名称并在 3 in 3 的屏幕上渲染,使用“下一个”和“上一个”按钮更改名称,并且可以过滤字母。 我想要添加一个新值,在输入中键入并单击按钮添加。 我的代码按钮: ad
我有一个组件实例,应该从不同的地方更新。如何从其他几个组件中更新此组件的 props? class ParentComponent extends React.Component { ...
我想问,是否可以基于变量返回一个组件,我的想法是否可以: var location = this.props.location // Eg. Asia,Australia 我的问题是我需要单独手动导
有没有办法在渲染后立即选择要覆盖的文本?我的意思是选择 - 最佳答案 您可以尝试使用两种方法.focus和.select .focus() method sets focus on the speci
我渲染了以下内容: 这是事件处理程序: handleCompanySubmit(event) { console.log("company submit") e
作为ReactJS的初学者,我现在使用出色的ReactJS Datepicker。有关我的自定义日期格式的问题: 我没有找到任何文档来解释所有可能性,例如M是月份,MM是2个字母的月份,依此类推。(我
我创建了一个表并正在对其进行过滤,但是当我清除搜索查询时,表数据不会显示,并且表会卡在查询结果上。SearchBox 是文本框,TableData 是表格,在 Container 中我正在更改 Sea
我在表格设置中有图标,这样当单击图标时,会呈现不同的图标。现在这工作正常,但我想为我单击的行中的特定行重新呈现不同的图标,而不是在每一行中重新呈现不同的图标。不知道我将如何去做这件事。这是我的代码:
我正在尝试使用 React 构建一个简单的应用程序,它有两个组件,一个嵌入另一个组件。子组件是一个收缩的菜单,单击它时,它会展开。我希望能够在单击父元素或子元素失去焦点时重新收缩它。 这是父组件的样子
我需要知道 REACT JS 或 HTML5 中是否有任何 API 可以提供用户不活动时自动注销的功能。我的代码如下,我不知道出了什么问题,它给了我错误 startTimer 未定义和不必要的绑定(b
我是一名优秀的程序员,十分优秀!