/userfiles/1/attachment/null/2023/10/13967b6b8332413f92ab67735873aa76.jpg|/userfiles/1/attachment/null/2023/10/17fd6e2c16144e66b8cd3ec495e6745f.png
后端传来图片的路径是按照 | 进行分隔的
首先在return中定义数组
在methods中添加分隔方法
- //将查询的图片路径分隔
- splitUrl(inputForm) {
- let imgUrl = inputForm.activityPicture
- this.activityPictureList = imgUrl.split("|");
- },
在获取数据时调用方法
二、将图片for循环到img标签中
- <el-col :span="12">
- <el-form-item label="党建图片" prop="activityPicture">
- <div v-for="(item, index) in this.activityPictureList">
- <el-image
- style="width: 100px; height: 100px"
- :src="item"
- :fit="fit"></el-image>
- </div>
- </el-form-item>
- </el-col>