列表的插槽

2020-09-08  本文已影响0人  流泪手心_521

1.第一种方式

 <el-table-column prop="status" label="状态" width="100">
          <template slot-scope="{row}">
            <el-switch
                    v-model="row.status"
                    active-color="#824C96"
                    :active-value="1"
                    :inactive-value="0"
                    @change="updateStatus(row)">
            </el-switch>
          </template>
        </el-table-column>

2.第二种方式

 <el-table-column prop="status" label="状态" width="100">
          <template slot-scope="scope">
            <el-switch
                v-model="scope.row.status"
                active-color="#824C96"
                :active-value="1"
                :inactive-value="0"
                @change="updateStatus(scope.row)">
            </el-switch>
          </template>
        </el-table-column>
上一篇 下一篇

猜你喜欢

热点阅读