webpack 小技巧:動態批量加載文件

背景 最近筆者在工做中遇到了一個小需求:vue 要實現一個組件來播放幀圖片webpack 這個需求自己不復雜,可是須要在組件中一次性引入十張圖片,就像下面這樣:程序員 // 就是這麼任性,下標從0開始~ import frame0 from './assets/frame_0.png' import frame1 from './assets/frame_1.png' import frame2
相關文章
相關標籤/搜索