amis
amis copied to clipboard
表头的单选过滤器filterable动态绑定

如果filterable设置source属性的话,会请求很多遍,而且会报错
TypeError: adaptor is not a function
如果在外层套一层service的话,数据也获取不了。
ps:文档没有对于filterable的描述
这种可以给filterable的source上配置cache:3000 // 3秒加缓存时间
@RickCole21 谢谢,那这里adaptor用不了吗
可以啊,你咋配的
{
"type": "crud",
"api": "https://houtai.baidu.com/api/sample?waitSeconds=1",
"footerToolbar": [
"statistics",
"switch-per-page",
"pagination"
],
"columns": [
{
"name": "browser",
"label": "Browser",
"sortable": true,
"type": "text",
"toggled": false
},
{
"name": "version",
"label": "Engine version",
"quickEdit": true,
"type": "text",
"toggled": true,
"filterable": {
"source": {
"url": "https://www.easy-mock.com/mock/5d5b6ef1af8d4d1bca47e65d/check/get_list",
"method": "get",
"cache": "3000",
"adaptor": "console.log(payload, 111); return payload"
}
}
}
]
}
有bug,我处理下
已修复 #205 ,等待发正式版哈
@RickCole21 嗯嗯看到了,谢谢。不过我设置了cache也没有用,请求了很多遍。
用number
谢谢