vue表格判断

两个判断

				<el-table
                    :data="personIdList"
                    style="width: 100%"
                    max-height="350"
                  >
                    <el-table-column
                      prop="sex"
                      label="性别"
                    >
                    <template slot-scope="scope">{{ scope.row.sex === 1 ? '男' : '女' }}template>
                    el-table-column>
                  el-table>

两个以上的判断

				<template slot-scope="scope">
                    <span
                      v-if="scope.row.sex == 0"
                      style="color: #F56C6C"
                    >span>
                    <span
                      v-else-if="scope.row.sex == 1"
                      style="color: #67C23A"
                    >span>
                    <span
                      v-else
                      style="color: #E6A23C"
                    >保密span>
                  template>

你可能感兴趣的:(elementUI,前端)