taro-ui
taro-ui copied to clipboard
Button $scope 未定义
问题描述 taro next 版本提交表单时报错 $scope 未定义 https://github.com/NervJS/taro-ui/blob/b702e9ab3df47bcb78253ec81c3112e94633235c/src/components/button/index.tsx#L65-L72
复现步骤
- 点击提交按钮报错
<AtForm
onSubmit={console.log}
>
<AtInput
name="phone"
title="手机号码"
type="phone"
placeholder="手机号码"
value={'132'}
/>
<AtButton
type="primary"
formType="submit"
>提交</AtButton>
</AtForm>
期望行为 不报错
报错信息
Cannot read property 'triggerEvent' of undefined; [Component] Event Handler Error @ pages/bindPhoneNumber/bindPhoneNumber#bound eventHandler
TypeError: Cannot read property 'triggerEvent' of undefined
at AtButton.onSumit (http://127.0.0.1:44237/appservice/vendors.js:5038:21)
at TaroElement.dispatchEvent (http://127.0.0.1:44237/appservice/taro.js:3576:29)
at Ue.eventHandler [as eh] (http://127.0.0.1:44237/appservice/taro.js:2215:10)
at Object.r.safeCallback (http://127.0.0.1:44237/appservice/__dev__/WAService.js:2:1697411)
at http://127.0.0.1:44237/appservice/__dev__/WAService.js:2:1828274
at s (http://127.0.0.1:44237/appservice/__dev__/WAService.js:2:1837621)
at http://127.0.0.1:44237/appservice/__dev__/WAService.js:2:1828199
at r (http://127.0.0.1:44237/appservice/__dev__/WAService.js:2:1774436)
at http://127.0.0.1:44237/appservice/__dev__/WAService.js:2:1774558
at http://127.0.0.1:44237/appservice/__dev__/WAService.js:2:833887
系统信息
👽 Taro v3.0.0-rc.2
Taro CLI 3.0.0-rc.2 environment info:
System:
OS: macOS 10.15.5
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.2.0 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
npmPackages:
@tarojs/cli: 3.0.0-rc.2 => 3.0.0-rc.2
@tarojs/components: 3.0.0-rc.2 => 3.0.0-rc.2
@tarojs/mini-runner: 3.0.0-rc.2 => 3.0.0-rc.2
@tarojs/react: 3.0.0-rc.2 => 3.0.0-rc.2
@tarojs/runtime: 3.0.0-rc.2 => 3.0.0-rc.2
@tarojs/taro: 3.0.0-rc.2 => 3.0.0-rc.2
@tarojs/webpack-runner: 3.0.0-rc.2 => 3.0.0-rc.2
babel-preset-taro: 3.0.0-rc.2 => 3.0.0-rc.2
eslint-config-taro: 3.0.0-rc.2 => 3.0.0-rc.2
react: 16.13.1 => 16.13.1
补充信息 无
我也是这个问题,有解答吗
我也是这个问题,有解答吗
没人解决吗??这么大的问题...
2023年了,这个问题仍在,最近用微信的填写昵称功能,官方建议用 submit 来解决。。。