1. 为CRUD.operation注入curd,免去属性传递 2. 表格界面零配置实现“表格列过滤显示”功能,弃用v-if方式 (#59)
⚡ CRUD优化
为CRUD.operation注入curd,免去属性传递
表格界面零配置实现“表格列过滤显示”功能,弃用v-if方式
This commit is contained in:
@@ -8,18 +8,18 @@
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="columns.visible('name')" prop="name" label="名称" />
|
||||
<el-table-column v-if="columns.visible('dept')" prop="dept" label="所属部门">
|
||||
<el-table-column prop="name" label="名称" />
|
||||
<el-table-column prop="dept" label="所属部门">
|
||||
<template slot-scope="scope">
|
||||
<div>{{ scope.row.deptSuperiorName ? scope.row.deptSuperiorName + ' / ' : '' }}{{ scope.row.dept.name }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="columns.visible('sort')" prop="sort" label="排序">
|
||||
<el-table-column prop="sort" label="排序">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.sort }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="columns.visible('status')" prop="status" label="状态" align="center">
|
||||
<el-table-column prop="status" label="状态" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.enabled"
|
||||
@@ -29,7 +29,7 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="创建日期">
|
||||
<el-table-column prop="createTime" label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user