jd-opensource / jd-opensource/taro-ui

配合使用taro-ui微信小程序下AtButton不能触发submit

Open
#1,437 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.7k
Forks
740
PR merge metrics
No merged PRs in 30d

Description

### 相关平台
微信小程序

**小程序基础库: 2.14.1**
**使用框架: Nerv**

### 复现步骤
taro-ui 3.0.0-alpha.8

```

提交

```

小程序报错信息
```
VM1410 WAService.js:2 TypeError: Cannot read property 'triggerEvent' of undefined
at AtButton.onSumit (vendors.js:8490)
at TaroElement.eventHandler (vendors.js:3075)
at TaroElement.dispatchEvent (element.ts:170)
at ge.eventHandler [as eh] (event.ts:100)
at Object.n.safeCallback (VM1410 WAService.js:2)
at VM1410 WAService.js:2
at a (VM1410 WAService.js:2)
at VM1410 WAService.js:2
at n (VM1410 WAService.js:2)
at VM1410 WAService.js:2
```

```
onSumit(event) {
if (this.state.isWEAPP || this.state.isWEB) {
// TODO: 3.0 this.$scope
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
this.$scope.triggerEvent('submit', event.detail, {
bubbles: true,
composed: true
});
}
}
```

### 期望结果
可配套ui少,希望能尽快修复

### 实际结果
,,

### 环境信息
```
� Taro v3.0.21

Taro CLI 3.0.21 environment info:
System:
OS: Windows 10
Binaries:
Node: 14.15.1 - D:\nodejs\node.EXE
npm: 6.14.10 - D:\nodejs\npm.CMD

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.