amis input-text组件的enter事件不生效

mec1mxoz  于 2022-12-31  发布在  其他
关注(0)|答案(5)|浏览(323)
描述问题:

input-text组件的enter事件不生效

截图或视频:

官网测试案例:

代码案例:

如何复现(请务必完整填写下面内容):
  1. 你是如何使用 amis 的?
    npm
  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    1.9.19
  3. 粘贴有问题的完整 amis schema 代码:
onEvent: {
            enter: {
              actions: [
                {
                  actionType: 'custom',
                  script: async (renderer, doAction, event) => {
                    console.log('enter---------------',)
                    return;
                  },
                },
              ]
            },
          }
  1. 操作步骤
    1.配置enter属性后,进行操作,不生效
x3naxklr

x3naxklr1#

input-textenter 事件目前仅在选择器 模式下生效

什么时候可以支持输入模式下有enter事件呢?

jtw3ybtb

jtw3ybtb2#

input-textenter 事件目前仅在选择器 模式下生效

h22fl7wq

h22fl7wq3#

input-textenter 事件目前仅在选择器 模式下生效

遇到同样问题 jssdk模式会经常用到各种事件 希望能尽可能的开放类似的自定义操作 暂时先用提交表单实现

pbgvytdp

pbgvytdp4#

@1562217380
我这样完成了 用表单的提交成功事件

{
						"type": "form",
						"title": "",
						"mode": "horizontal",
						"submitText": "",
						"id": "l2d4wn3s",
						"body": [
							{
								"type": "input-text",
								"name": "QrCode",
								"style": {
									"width": "300px"
								},
								"label": "条码录入:",
							},
						],
						"onEvent": {
							"submitSucc": {
								"weight": 0,
								"actions": [
									{
										"actionType": "custom",
										"script": (context, doAction, event) => {
											console.log(event.data.QrCode);//取本组件的 值											
										}
									}
								]
							}
						},
					},
92vpleto

92vpleto5#

将input与表格绑定在一起,也可以达到目的,表格的filter与form的input自带enter事件

相关问题