|
1 | 1 | import classNames from 'classnames'
|
2 | 2 | import PropTypes, { InferProps } from 'prop-types'
|
3 | 3 | import React from 'react'
|
4 |
| -import { Button, Form, View } from '@tarojs/components' |
| 4 | +import { Button, View } from '@tarojs/components' |
5 | 5 | import { ButtonProps } from '@tarojs/components/types/Button'
|
6 | 6 | import { BaseEventOrig, CommonEvent } from '@tarojs/components/types/common'
|
7 | 7 | import Taro from '@tarojs/taro'
|
@@ -62,30 +62,6 @@ export default class AtButton extends React.Component<
|
62 | 62 | this.props.onOpenSetting && this.props.onOpenSetting(event)
|
63 | 63 | }
|
64 | 64 |
|
65 |
| - private onSumit(event: CommonEvent): void { |
66 |
| - if (this.state.isWEAPP || this.state.isWEB) { |
67 |
| - // TODO: 3.0 this.$scope |
68 |
| - // eslint-disable-next-line @typescript-eslint/ban-ts-ignore |
69 |
| - // @ts-ignore |
70 |
| - this.$scope.triggerEvent('submit', event.detail, { |
71 |
| - bubbles: true, |
72 |
| - composed: true |
73 |
| - }) |
74 |
| - } |
75 |
| - } |
76 |
| - |
77 |
| - private onReset(event: CommonEvent): void { |
78 |
| - if (this.state.isWEAPP || this.state.isWEB) { |
79 |
| - // TODO: 3.0 this.$scope |
80 |
| - // eslint-disable-next-line @typescript-eslint/ban-ts-ignore |
81 |
| - // @ts-ignore |
82 |
| - this.$scope.triggerEvent('reset', event.detail, { |
83 |
| - bubbles: true, |
84 |
| - composed: true |
85 |
| - }) |
86 |
| - } |
87 |
| - } |
88 |
| - |
89 | 65 | public render(): JSX.Element {
|
90 | 66 | const {
|
91 | 67 | size = 'normal',
|
@@ -162,14 +138,7 @@ export default class AtButton extends React.Component<
|
162 | 138 | onClick={this.onClick.bind(this)}
|
163 | 139 | >
|
164 | 140 | {isWEB && !disabled && webButton}
|
165 |
| - {isWEAPP && !disabled && ( |
166 |
| - <Form |
167 |
| - onSubmit={this.onSumit.bind(this)} |
168 |
| - onReset={this.onReset.bind(this)} |
169 |
| - > |
170 |
| - {button} |
171 |
| - </Form> |
172 |
| - )} |
| 141 | + {isWEAPP && !disabled && button} |
173 | 142 | {isALIPAY && !disabled && button}
|
174 | 143 | {loadingComponent}
|
175 | 144 | <View className='at-button__text'>{this.props.children}</View>
|
|
0 commit comments