taro-ui icon indicating copy to clipboard operation
taro-ui copied to clipboard

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

Open xiaof520 opened this issue 4 years ago • 6 comments

相关平台

微信小程序

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

复现步骤

taro-ui 3.0.0-alpha.8

               <AtForm
                   onSubmit={this.onSubmit.bind(this)}
               >
                       <AtButton type='primary' formType='submit'>提交</AtButton>
               </AtForm>

小程序报错信息

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


xiaof520 avatar Jan 04 '21 05:01 xiaof520

-- 走胡同了,button改taro组件,不用taro-ui的button

xiaof520 avatar Jan 04 '21 05:01 xiaof520

求助,这个问题还没修复吗,我的taro版本是3.0.18

superchangme avatar Apr 25 '21 08:04 superchangme

求助,这个问题还没修复吗,我的taro-ui版本是[email protected]

hs185556 avatar May 11 '21 09:05 hs185556

好家伙,一模一样的问题

Derekgogo avatar Jan 27 '22 01:01 Derekgogo

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

taro-ui-bot[bot] avatar Jan 27 '22 04:01 taro-ui-bot[bot]

直接升级到beta.4版本后解决:

diff --git a/package.json b/package.json
index 4129b9a..1504e54 100644
--- a/package.json
+++ b/package.json
@@ -51,7 +51,7 @@
     "redux": "^4.1.0",
     "redux-logger": "^3.0.6",
     "redux-thunk": "^2.3.0",
-    "taro-ui": "3.1.0-beta.2"
+    "taro-ui": "3.1.0-beta.4"
   },
   "devDependencies": {
     "@babel/core": "^7.8.0",
@@ -66,5 +66,8 @@
     "eslint-plugin-react": "^7.8.2",
     "eslint-plugin-react-hooks": "^4.2.0",
     "stylelint": "9.3.0"
+  },
+  "resolutions": {
+    "sass": "^1.58.3"
   }
 }

Eric-Guo avatar Feb 25 '23 09:02 Eric-Guo