action的防抖不生效,设置leading为true,trailing为false,没有起到防抖作用
Opened this issue · 0 comments
nabaonan commented
描述问题:
设置leading为true,trailing为false,没有起到防抖作用
截图或视频:
如何复现(请务必完整填写下面内容):
-
你是如何使用 amis 的?
官网的编辑器 -
amis 版本是什么?请先在最新 beta 版本测试问题是否存在
官方编辑器页面测试 -
粘贴有问题的完整
amis schema
代码:
{
"type": "page",
"title": "Hello world",
"body": [
{
"type": "button",
"id": "u:bef6ebd73a3f",
"label": "按钮",
"onEvent": {
"click": {
"actions": [
{
"args": {},
"actionType": "custom",
"script": "/* 自定义JS使用说明:\n * 1.动作执行函数doAction,可以执行所有类型的动作\n * 2.通过上下文对象context可以获取当前组件实例,例如context.props可以获取该组件相关属性\n * 3.事件对象event,在doAction之后执行event.stopPropagation();可以阻止后续动作执行\n*/\nconst myMsg = '我是自定义JS';\ndoAction({\n actionType: 'toast',\n args: {\n msg: myMsg\n }\n});\n"
}
],
"debounce": {
"leading": true,
"wait": 1000,
"trailing": false
}
}
}
}
],
"id": "u:c2a087973790"
}
- 操作步骤
连续点击按钮,不会有防抖间隔,会立即触发