第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

沒有報錯但是圖片沒有顯示到網(wǎng)頁上

沒有報錯但是圖片沒有顯示到網(wǎng)頁上

慕運維8582118 2018-09-13 16:07:50
//加載CSS require('normalize.css/normalize.css'); require('styles/App.scss'); import?React?from?'react'; //獲取圖片相關數(shù)據(jù) const?imageDatas?=?require('json-loader!../data/imageDatas.json'); //利用自執(zhí)行函數(shù),將圖片名信息轉(zhuǎn)成圖片URL路徑信息 ImageData?=?(function?genImageURL(imageDataArr)?{ ??for?(var?i?=?0,?j?=?imageDataArr.length;?i?<?j;?i++)?{ ????var?singleImageData?=?imageDataArr[i]; ????singleImageData.imageURL?=?require('../images/'?+?singleImageData.fileName); ????imageDataArr[i]?=?singleImageData; ??} ??return?imageDataArr; })(ImageData); //單個圖片組件 class?ImgFigure?extends?React.Component?{ ??render()?{ ????return?( ??????<figure> ????????<img?src={this.props.data.imageURL} ?????????????alt={this.props.data.title}/> ????????<figcaption> ??????????<h2>{this.props.data.title}</h2> ????????</figcaption> ??????</figure> ????); ??} } class?GalleryAPP?extends?React.Component?{ ??render()?{ ????var?controllerUnits?=?[], ??????imgFigures?=?[]; ????imageDatas.forEach(function?(value)?{ ??????imgFigures.push(<ImgFigure?data={value}/>); ????}); ????return?( ??????<section?className="stage"> ????????<section?className="img-sec"> ??????????{imgFigures} ????????</section> ????????<nav?className="controller-nav"> ??????????{controllerUnits} ????????</nav> ??????</section> ????); ??} } GalleryAPP.defaultProps?=?{}; export?default?GalleryAPP;
查看完整描述

1 回答

?
慕運維8582118

TA貢獻1條經(jīng)驗 獲得超0個贊

Main.js?7cd4:13 Uncaught TypeError: Cannot read property 'fileName' of undefined

? ? at genImageURL (eval at <anonymous> (app.js:2437), <anonymous>:35:80)

? ? at Object.eval (eval at <anonymous> (app.js:2437), <anonymous>:39:2)

? ? at Object.eval (eval at <anonymous> (app.js:2437), <anonymous>:119:27)

? ? at eval (eval at <anonymous> (app.js:2437), <anonymous>:120:30)

? ? at Object.<anonymous> (app.js:2437)

? ? at __webpack_require__ (app.js:556)

? ? at fn (app.js:87)

? ? at Object.eval (eval at <anonymous> (app.js:1051), <anonymous>:15:13)

? ? at Object.eval (eval at <anonymous> (app.js:1051), <anonymous>:24:27)

? ? at eval (eval at <anonymous> (app.js:1051), <anonymous>:25:30)


查看完整回答
反對 回復 2018-09-13
  • 1 回答
  • 0 關注
  • 1065 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號