vue+element-ui之 el-table组件中 的理解和使用

element-ui官网的table组件中提到:element-ui

经过 Scoped slot 能够获取到 row, column, $index 和 store(table 内部的状态管理)的数据。ui

使用:spa

<el-table-column prop="金额" label="金额(万)" min-width="120" align="center" > <template slot-scope="scope" > <p @click="function1(scope.row.data1,'参数')">
      {{scope.row['金额']|toFixedNum(param)|numFormat(param)}}
     </p>
   </template>
</el-table-column>

 如上述代码,能够在<template scope="scope">中经过scope.row.键名,获取所在行的某一列的数据。同时能够添加点击事件,也能够使用过滤器;.net

 

emm......关于<template scope="scope">的理解,原本想多写点,一直很忙没时间,等后来有空了,想一想下方连接的做者写的不错,那就直接贴上这个连接吧:code

http://www.javashuo.com/article/p-cqamrfxa-kh.htmlorm

相关文章
相关标签/搜索