圖片是放在assets文件夾下的
使用require進行解決
圖片不顯示的原因
在webpack,將圖片放在assets中,會將圖片圖片來當做模塊來用,因為是動態加載的,所以url-loader將無法解析圖片地址,
<el-table-column label="照片"> <template slot-scope="scope"> <i class="el-icon-picture-outline" @click="showPhoto(scope.row)"></i> <img id="aa" :src="scope.row.img" /> </template> </el-table-column>
{ date: "2016-05-02", studentId: "201319981010", name: "王2虎", className: "高2018級2班", img: require("../../../assets/image/wearther.png"), //引號中括號里面哦 address: "區金沙江路 1518 弄" },