感謝老師,終于踩完所有的坑,基于最新版webpack,附帶詳細(xì)注釋
地址:https://github.com/yangxiaosen/gallery-by-react
演示:https://yangxiaosen.github.io/gallery-by-react/
歡迎糾錯(cuò)~
地址:https://github.com/yangxiaosen/gallery-by-react
演示:https://yangxiaosen.github.io/gallery-by-react/
歡迎糾錯(cuò)~
2017-02-07
react入門學(xué)的老師這個(gè)例子,當(dāng)初寫的時(shí)候痛苦萬(wàn)分,很多地方其實(shí)不是react的地方頭痛而是這個(gè)畫廊應(yīng)用的某些邏輯部分,所以后來(lái)又重構(gòu)了好幾次,組件拆分,方法拆分,ES6語(yǔ)法的重寫,邏輯簡(jiǎn)化,簡(jiǎn)化變量命名,完善注釋,來(lái)增強(qiáng)代碼的可讀性,版本從v1.0暫時(shí)到v1.2, 以后還會(huì)重構(gòu)下去,代碼在https://github.com/ckinmind/gallery-by-react,我甚至畫了個(gè)扇區(qū)的示意圖,希望對(duì)后來(lái)學(xué)的朋友有所幫助
2017-01-29
if (!this.state.imgsArrangeArr[index]) {
this.state.imgsArrangeArr[index] = {
pos: {
left: 0,
top: 0
}
}
}
這里老師寫的有筆誤吧
this.state.imgsArrangeArr[index] = {
pos: {
left: 0,
top: 0
}
}
}
這里老師寫的有筆誤吧
2017-01-17
https://github.com/webpack/json-loader
Note: Since webpack v2, JSON files will work by default. You might still want to use this if you use a custom file extension.
Note: Since webpack v2, JSON files will work by default. You might still want to use this if you use a custom file extension.
2017-01-12