Comments (5)
@zollero 明白了,非常感谢提醒,的确是你说的,这么看来的话,其实col上render和formatter是基本一致的作用,不过我还是做了一点修改,如果定义了formatter并且没有定义render的话,会使用formatter,想法主要有两个:
- 尽量和el-table的定义保持一致
- 也是比较关键的一点,
formatter
的参数内带了cellValue
,所以在同一个表格呢如果有多个字段需要做同样的格式化时,如果使用render
就需要写不同的函数去处理各自的prop
,用formatter
的话就可以共用
不过是否合并,还看你的决定,我等会儿submit一个PR,谢谢
from el-search-table-pagination.
@pzgz 请使用column的 render 函数,render 函数有一个参数,是当前行数据的对象。
from el-search-table-pagination.
嗯,我注意到render这个函数了,本来还是想继续尝试用原有的formatter,主要是有点强迫症,想弄清楚为什么,直接看源代码,也没发现有啥问题
from el-search-table-pagination.
@pzgz 有可能是 el-search 使用了内嵌slot的方式,覆盖了 formatter 解析的数值
from el-search-table-pagination.
Good job!
from el-search-table-pagination.
Related Issues (20)
- slot prepend append是el-table的插槽,不是el-search-table-pagination的插槽,要怎么使用呢?
- 自己添加了按钮为什么查询不可以?下面是源码请大神解答
- 希望能给form表单的重置按钮添加回调 HOT 1
- 看源码el-table和el-table-column属性和事件绑定太麻烦了,有简单方式 HOT 2
- resetBtnCallback回调执行重新查询时其他条件正常重置,但daterange不能重置 HOT 2
- render函数return的内容怎么让换行显示 HOT 1
- 可以实现模糊查询吗? HOT 4
- 关于使用后的一些建议 HOT 2
- 设置table为remote的模式时,form的search按钮会抖动 HOT 3
- Possibility argument issue for function searchHandler HOT 1
- 希望form中的select改变时能添加传递change事件 HOT 1
- 验证 HOT 1
- 报错:javascript miss dev ,如何解决 HOT 2
- 自定义列使用slotName属性时,出现重复
- 多级联动的选择框取值和传参 HOT 1
- Usage of column type "expand"
- 如果要在table中的某一列显示图片,使用render吗
- Set search form values HOT 2
- 筛选栏 目前是不支持远程模糊搜索吗 remoteMethod HOT 1
- from 的button 属性不支持透传过去吗
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from el-search-table-pagination.