vue动态显示列表内容代码片段

àì夳堔傛蜴生んèń 2023-06-03 07:56 72阅读 0赞

vue动态显示列表内容代码片段
下拉显示:
search.departid代表绑定的数据
departlist为要显示的列表名,在获取到后端数据后赋值

  1. <div class="col-xs-2">
  2. <div class="input-group">
  3. <span class="input-group-addon">机构名称:</span>
  4. <select class="form-control" v-model="search.departid">
  5. <option v-for="item in departlist" :key="item.id" :value="item.id">{
  6. {item.name}}</option>
  7. </select>
  8. </div>
  9. </div>

效果:
1.0

在表单中显示:

  1. <el-table-column label="图片" prop="photos" resizable show-overflow-tooltip>
  2. <template slot-scope="scope">
  3. <span v-for="photo in scope.row.photos" :key="photo">
  4.  <img :src="'images/upload/'+photo" width="60" height="60" class="head_pic" />
  5. </span>
  6. </template>
  7. </el-table-column>

<el-collapse v-model="activeNames" @change="handleChange"> <el-table ref="multipleTable" :data="userlist" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange"> <el-table-column type="selection" width="55"> </el-table-column> <el-table-column label="机构人员" > <template slot-scope="scope">{ { scope.row.name }}</template> </el-table-column> <el-table-column prop="departmentDO.name" label="所属机构" width="120"> </el-table-column> </el-table> </el-collapse>

发表评论

表情:
评论列表 (有 0 条评论,72人围观)

还没有评论,来说两句吧...

相关阅读