- 在methods的函数中调用另一个函数
mothods:{
aaa(){
alter('000')
},
bbb(){
this.aaa()
alter('111')
}
}
- 点击表格单元格或者一行,触发事件
<el-table xxxxxxx @row-click='clickrow'>
<el-table xxxxxxx @cell-click='clickcell'>
mothods:{
clickrow(row, event, column){
xxxxxx
},
clickcell(row, event, column, cell){
xxxxx
}
}
- 根据表格的值,替换成相对应的图标
<el-table-column prop="status" label="状态" min-width="10/100">
<template slot-scope="scope">
<span v-if="scope.row.status == '0'">
<!-- 0 代表未上传 -->
<i class="el-icon-upload"></i>
</span>
<span v-else-if="scope.row.status == '1'">
<!-- 1 代表正在上传 -->
<i class="el-icon-loading"></i>
</span>
<span v-else="scope.row.status == '2'">
<!-- 2 代表已上传 -->
<i class="el-icon-video-play"></i>
</span>
</template>
</el-table-column>
我是清茶!欢迎你和我一起讨论,我们下期见。