.smart-table
el-table.smart-table(
:data="data"
:stripe="isStripe"
:row-class-name="rowClassName"
:size="size"
@sort-change="sortChange"
@row-click="rowClick")
el-table-column(
v-for="(item, index) in realConfig.normal"
:key="`normal_${index}`"
:width="item.width"
:height="item.height"
:min-width="item.minWidth"
:prop="item.prop"
:sortable="item.sort"
:class-name="item.className"
:label="item.label")
template(#default="{row, column}")
slot(v-if="item.type === 'slot'" :name="column.property" :data="row")
el-progress(v-else-if="item.type === 'progress'" :percentage="row[item.prop]")
template(v-else-if="realValue")
el-tooltip(v-if="item.inline" :content="realValue.bind(this, row, item)()" placement="top-start")
span.inline(:style="{maxWidth: `${item.width}px`}" v-html="realValue.bind(this, row, item)()")
span(v-else v-html="realValue.bind(this, row, item)()")
el-table-column(
v-for="(item, index) in realConfig.expand"
:key="`expand_${index}`"
:width="item.width"
:min-width="item.minWidth"
type="expand"
:label="item.label"
:class-name="item.className")
template(#default="{row, column}")
SmartTable(:data='realValue.bind(this, row, item)()' :config="item.config")
el-table-column(
:label="operationsTitle"
:width="operationsWidth"
v-if="operations.length")
template(#default="scope")
el-popover(
v-for="(btn, index) in operations"
:disabled="!btn.check"
placement="top"
trigger="hover"
width="160"
:key="index")
p {{btn.check}}
div(style="text-align: right; margin: 0")
el-button(type="primary", size="mini", @click="btn.action.bind(this, scope)()") 确定
el-button(
slot="reference"
:size="btn.size"
:type="btn.type"
:disabled="typeof btn.disabled === 'function' ? btn.disabled.bind(this, scope)() : btn.disabled"
v-show="typeof btn.visible === 'function' ? btn.visible.bind(this, scope)() : true"
@click="!btn.check && btn.action.bind(this, scope)()"
) {{typeof btn.label === 'function' ? btn.label.bind(this, scope)() : btn.label}}
el-pagination(
v-if="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:page-sizes="sizes"
:page-size.sync="step"
:current-page.sync="current"
:layout="layout"
:total="total")