ahooksjs / useTable

A Progressive Solution for Query Table Scene
https://usetable-ahooks.js.org
MIT License
46 stars 6 forks source link

使用useFilterPlugin点击筛选列的“重置”按钮后,上一次选择的值还存在 #9

Closed Gamehu closed 3 years ago

Gamehu commented 3 years ago

版本升级到0.1.7后,重置问题还是存在

package.json

"@ahooksjs/next-form-table": "^0.1.7",
"@ahooksjs/use-adapt-plugin": "^0.1.7",
"@ahooksjs/use-async-default-plugin": "^0.1.7",
"@ahooksjs/use-filter-plugin": "^0.1.7",
"@ahooksjs/use-selection-plugin": "^0.1.7",
"@ahooksjs/use-sortable-plugin": "^0.1.7",
"@ahooksjs/use-tree-plugin": "^0.1.7",

codesandbox

demo

a

monkindey commented 3 years ago

感觉这个内置做不太好,因为如果有两个字段需要 filter,这个时候重置某一个之后,我这边不清楚你设置的 transformer 的处理逻辑是什么,可能会把一些不必要的数据给情况掉了。所以加上 transformer 之后,你需要自己控制数据。

你加上 transformer 的使用场景是需要要加上另外参数还是想改变传给后端参数 key 名而已?

monkindey commented 3 years ago

改变传给后端参数 key 名,可以参考 https://github.com/ahooksjs/useTable/blob/master/packages/use-filter-plugin/demo/transformer.tsx