码迷,mamicode.com
首页 > 其他好文 > 详细

element 表格中使用if语句,scope写法

时间:2018-02-08 17:49:40      阅读:6753      评论:0      收藏:0      [点我收藏+]

标签:edit   row   100%   log   仓库   type   des   click   写法   

<el-table v-cloak id="mybox" :row-class-name="tableRowClassName" height="100%" :data="pageDate" style="width:100%;height:100%"
:default-sort="{prop: ‘date‘, order: ‘descending‘}">
<el-table-column prop="name" fixed label="仓库名称" sortable>
</el-table-column>
<el-table-column prop="telePhone" label="电话号码">
</el-table-column>
<el-table-column prop="state" label="仓库状态" sortable>
<template slot-scope="scope">
<span>{{scope.row.state==1?‘正常‘:"关闭"}}</span>
<!-- <span v-if=‘scope.row.state==0‘>关闭</span> -->
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" sortable>
<template slot-scope="scope">
<span>{{scope.row.createTime |capitalize}}</span>
<!-- <span v-if=‘scope.row.state==0‘>关闭</span> -->
</template>
</el-table-column>
<el-table-column prop="updateTime" label="修改时间" sortable>
<template slot-scope="scope">
<span>{{scope.row.createTime|capitalize}}</span>
<!-- <span v-if=‘scope.row.state==0‘>关闭</span> -->
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" fixed width=‘300px‘>
<template slot-scope="scope">
<el-button type="primary" v-if=‘scope.row.state==1‘ @click=‘editModleShow(scope.row)‘ icon="el-icon-edit" size="small">编辑</el-button>
<el-button type="primary" v-if=‘scope.row.state==1‘ @click=‘deleteModleShow(scope.row)‘ icon="el-icon-delete" size="small">删除</el-button>
<el-button type="info" v-if=‘scope.row.state==1‘ @click=‘forbidModleShow(scope.row)‘ icon="el-icon-info" size="small">禁用</el-button>
<el-button type="primary" v-if=‘scope.row.state==0‘ plain @click=‘forbidModleShow(scope.row)‘ icon="el-icon-success" size="small">启用</el-button>
</template>
</el-table-column>
</el-table>

element 表格中使用if语句,scope写法

标签:edit   row   100%   log   仓库   type   des   click   写法   

原文地址:https://www.cnblogs.com/zhuwu/p/8432188.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!