psaren / taro-ui-vue

UI KIT for Taro/vue
MIT License
206 stars 38 forks source link

taro-ui-vue在支付宝小程序下运行taro项目AtButton组件报错 #99

Open FuYee opened 3 years ago

FuYee commented 3 years ago

问题描述 taro-ui-vue在支付宝小程序下运行taro项目AtButton组件报错,使用的版本是1.0.0-beta.5,尝试过切换到其他版本,同样报错,包括支付宝开发工具版本号,更换后也报同样的错误

复现步骤

1.npm i taro-ui-vue@1.0.0-beta.5 -S
2.app.ts入口文件引入css:   import 'taro-ui-vue/dist/style/index.scss'
在test.vue文件测试
<template>
  <view>
     <AtButton>
          button按钮测试
        </AtButton>
 </view>
<template>
<script>
import { AtButton } from 'taro-ui-vue'
export default {
   components: {
     AtButton
   }
}
</script>

运行后在支付宝小程序开发工具报错,但是按钮能正常显示

期望行为 在支付宝开发工具上运行不报错

报错信息 vendors.js:23750 [Vue warn]: Invalid handler for event "getUserInfo": got undefined

found in

---> at node_modules/_taro-ui-vue@1.0.0-beta.5@taro-ui-vue/src/components/button/index.vue

at src/pages/wxcommon/index/index.vue warn @ vendors.js:23750 updateListeners @ vendors.js:25329 updateDOMListeners @ vendors.js:30071 invokeCreateHooks @ vendors.js:29189 createElm @ vendors.js:29076 createChildren @ vendors.js:29173 createElm @ vendors.js:29074 patch @ vendors.js:29597 Vue._update @ vendors.js:27069 updateComponent @ vendors.js:27190 get @ vendors.js:27603 Watcher @ vendors.js:27590 mountComponent @ vendors.js:27197 Vue.$mount @ vendors.js:31535 init @ vendors.js:26245 createComponent @ vendors.js:29098 createElm @ vendors.js:29045 createChildren @ vendors.js:29173 createElm @ vendors.js:29074 patch @ vendors.js:29597 Vue._update @ vendors.js:27069 updateComponent @ vendors.js:27190 get @ vendors.js:27603 Watcher @ vendors.js:27590 mountComponent @ vendors.js:27197 Vue.$mount @ vendors.js:31535 init @ vendors.js:26245 createComponent @ vendors.js:29098 createElm @ vendors.js:29045 createChildren @ vendors.js:29173 createElm @ vendors.js:29074 patch @ vendors.js:29597 Vue._update @ vendors.js:27069 updateComponent @ vendors.js:27190 get @ vendors.js:27603 Watcher @ vendors.js:27590 mountComponent @ vendors.js:27197 Vue.$mount @ vendors.js:31535 init @ vendors.js:26245 createComponent @ vendors.js:29098 createElm @ vendors.js:29045 addVnodes @ vendors.js:29226 patchVnode @ vendors.js:29445 patch @ vendors.js:29602 Vue._update @ vendors.js:27072 (anonymous) @ taro.js:4819 updateSync @ taro.js:4818 mount @ taro.js:4813 mount @ taro.js:4840 onLoad @ taro.js:4200 (anonymous) @ af-appx.worker.min.js:26 Tt @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 batchedUpdates @ af-appx.worker.min.js:26 executeUserFunction @ af-appx.worker.min.js:26 firePageEvent @ af-appx.worker.min.js:26 fireLegacyEvent @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 runBatch @ af-appx.worker.min.js:26 preload @ af-appx.worker.min.js:26 load @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 Cr @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 Promise.then (async) Ir @ af-appx.worker.min.js:26 Ar @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 (anonymous) @ VM94 vendors.bundle.js:66 e.handleMessageFromRender4Init @ VM94 vendors.bundle.js:66 e.handleMessageFromRender @ VM94 vendors.bundle.js:66 e.postMessage @ VM94 vendors.bundle.js:51 e.handleAPI4PostMessage @ VM94 vendors.bundle.js:79 e.bridgeCall @ VM94 vendors.bundle.js:79 e.callBridgePluginAsyncInternal @ VM94 vendors.bundle.js:79 (anonymous) @ VM94 vendors.bundle.js:79 setTimeout (async) e.bridgeCall @ VM94 vendors.bundle.js:79 t.invokeBridgeAsync @ VM94 vendors.bundle.js:66 call @ VM94 vendors.bundle.js:51 postMessage @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 then @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 Pe @ VM2840 af-appx.min.js:13 mt @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 then @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 vendors.js:23750 [Vue warn]: Invalid handler for event "getPhoneNumber": got undefined found in ---> at node_modules/_taro-ui-vue@1.0.0-beta.5@taro-ui-vue/src/components/button/index.vue at src/pages/wxcommon/index/index.vue warn @ vendors.js:23750 updateListeners @ vendors.js:25329 updateDOMListeners @ vendors.js:30071 invokeCreateHooks @ vendors.js:29189 createElm @ vendors.js:29076 createChildren @ vendors.js:29173 createElm @ vendors.js:29074 patch @ vendors.js:29597 Vue._update @ vendors.js:27069 updateComponent @ vendors.js:27190 get @ vendors.js:27603 Watcher @ vendors.js:27590 mountComponent @ vendors.js:27197 Vue.$mount @ vendors.js:31535 init @ vendors.js:26245 createComponent @ vendors.js:29098 createElm @ vendors.js:29045 createChildren @ vendors.js:29173 createElm @ vendors.js:29074 patch @ vendors.js:29597 Vue._update @ vendors.js:27069 updateComponent @ vendors.js:27190 get @ vendors.js:27603 Watcher @ vendors.js:27590 mountComponent @ vendors.js:27197 Vue.$mount @ vendors.js:31535 init @ vendors.js:26245 createComponent @ vendors.js:29098 createElm @ vendors.js:29045 createChildren @ vendors.js:29173 createElm @ vendors.js:29074 patch @ vendors.js:29597 Vue._update @ vendors.js:27069 updateComponent @ vendors.js:27190 get @ vendors.js:27603 Watcher @ vendors.js:27590 mountComponent @ vendors.js:27197 Vue.$mount @ vendors.js:31535 init @ vendors.js:26245 createComponent @ vendors.js:29098 createElm @ vendors.js:29045 addVnodes @ vendors.js:29226 patchVnode @ vendors.js:29445 patch @ vendors.js:29602 Vue._update @ vendors.js:27072 (anonymous) @ taro.js:4819 updateSync @ taro.js:4818 mount @ taro.js:4813 mount @ taro.js:4840 onLoad @ taro.js:4200 (anonymous) @ af-appx.worker.min.js:26 Tt @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 batchedUpdates @ af-appx.worker.min.js:26 executeUserFunction @ af-appx.worker.min.js:26 firePageEvent @ af-appx.worker.min.js:26 fireLegacyEvent @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 runBatch @ af-appx.worker.min.js:26 preload @ af-appx.worker.min.js:26 load @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 Cr @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 Promise.then (async) Ir @ af-appx.worker.min.js:26 Ar @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 (anonymous) @ VM94 vendors.bundle.js:66 e.handleMessageFromRender4Init @ VM94 vendors.bundle.js:66 e.handleMessageFromRender @ VM94 vendors.bundle.js:66 e.postMessage @ VM94 vendors.bundle.js:51 e.handleAPI4PostMessage @ VM94 vendors.bundle.js:79 e.bridgeCall @ VM94 vendors.bundle.js:79 e.callBridgePluginAsyncInternal @ VM94 vendors.bundle.js:79 (anonymous) @ VM94 vendors.bundle.js:79 setTimeout (async) e.bridgeCall @ VM94 vendors.bundle.js:79 t.invokeBridgeAsync @ VM94 vendors.bundle.js:66 call @ VM94 vendors.bundle.js:51 postMessage @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 then @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 Pe @ VM2840 af-appx.min.js:13 mt @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 then @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 vendors.js:23750 [Vue warn]: Invalid handler for event "openSetting": got undefined found in ---> at node_modules/_taro-ui-vue@1.0.0-beta.5@taro-ui-vue/src/components/button/index.vue at src/pages/wxcommon/index/index.vue warn @ vendors.js:23750 updateListeners @ vendors.js:25329 updateDOMListeners @ vendors.js:30071 invokeCreateHooks @ vendors.js:29189 createElm @ vendors.js:29076 createChildren @ vendors.js:29173 createElm @ vendors.js:29074 patch @ vendors.js:29597 Vue._update @ vendors.js:27069 updateComponent @ vendors.js:27190 get @ vendors.js:27603 Watcher @ vendors.js:27590 mountComponent @ vendors.js:27197 Vue.$mount @ vendors.js:31535 init @ vendors.js:26245 createComponent @ vendors.js:29098 createElm @ vendors.js:29045 createChildren @ vendors.js:29173 createElm @ vendors.js:29074 patch @ vendors.js:29597 Vue._update @ vendors.js:27069 updateComponent @ vendors.js:27190 get @ vendors.js:27603 Watcher @ vendors.js:27590 mountComponent @ vendors.js:27197 Vue.$mount @ vendors.js:31535 init @ vendors.js:26245 createComponent @ vendors.js:29098 createElm @ vendors.js:29045 createChildren @ vendors.js:29173 createElm @ vendors.js:29074 patch @ vendors.js:29597 Vue._update @ vendors.js:27069 updateComponent @ vendors.js:27190 get @ vendors.js:27603 Watcher @ vendors.js:27590 mountComponent @ vendors.js:27197 Vue.$mount @ vendors.js:31535 init @ vendors.js:26245 createComponent @ vendors.js:29098 createElm @ vendors.js:29045 addVnodes @ vendors.js:29226 patchVnode @ vendors.js:29445 patch @ vendors.js:29602 Vue._update @ vendors.js:27072 (anonymous) @ taro.js:4819 updateSync @ taro.js:4818 mount @ taro.js:4813 mount @ taro.js:4840 onLoad @ taro.js:4200 (anonymous) @ af-appx.worker.min.js:26 Tt @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 batchedUpdates @ af-appx.worker.min.js:26 executeUserFunction @ af-appx.worker.min.js:26 firePageEvent @ af-appx.worker.min.js:26 fireLegacyEvent @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 runBatch @ af-appx.worker.min.js:26 preload @ af-appx.worker.min.js:26 load @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 Cr @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 Promise.then (async) Ir @ af-appx.worker.min.js:26 Ar @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 (anonymous) @ VM94 vendors.bundle.js:66 e.handleMessageFromRender4Init @ VM94 vendors.bundle.js:66 e.handleMessageFromRender @ VM94 vendors.bundle.js:66 e.postMessage @ VM94 vendors.bundle.js:51 e.handleAPI4PostMessage @ VM94 vendors.bundle.js:79 e.bridgeCall @ VM94 vendors.bundle.js:79 e.callBridgePluginAsyncInternal @ VM94 vendors.bundle.js:79 (anonymous) @ VM94 vendors.bundle.js:79 setTimeout (async) e.bridgeCall @ VM94 vendors.bundle.js:79 t.invokeBridgeAsync @ VM94 vendors.bundle.js:66 call @ VM94 vendors.bundle.js:51 postMessage @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 then @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 Pe @ VM2840 af-appx.min.js:13 mt @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 then @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 vendors.js:23750 [Vue warn]: Invalid handler for event "error": got undefined found in ---> at node_modules/_taro-ui-vue@1.0.0-beta.5@taro-ui-vue/src/components/button/index.vue at src/pages/wxcommon/index/index.vue warn @ vendors.js:23750 updateListeners @ vendors.js:25329 updateDOMListeners @ vendors.js:30071 invokeCreateHooks @ vendors.js:29189 createElm @ vendors.js:29076 createChildren @ vendors.js:29173 createElm @ vendors.js:29074 patch @ vendors.js:29597 Vue._update @ vendors.js:27069 updateComponent @ vendors.js:27190 get @ vendors.js:27603 Watcher @ vendors.js:27590 mountComponent @ vendors.js:27197 Vue.$mount @ vendors.js:31535 init @ vendors.js:26245 createComponent @ vendors.js:29098 createElm @ vendors.js:29045 createChildren @ vendors.js:29173 createElm @ vendors.js:29074 patch @ vendors.js:29597 Vue._update @ vendors.js:27069 updateComponent @ vendors.js:27190 get @ vendors.js:27603 Watcher @ vendors.js:27590 mountComponent @ vendors.js:27197 Vue.$mount @ vendors.js:31535 init @ vendors.js:26245 createComponent @ vendors.js:29098 createElm @ vendors.js:29045 createChildren @ vendors.js:29173 createElm @ vendors.js:29074 patch @ vendors.js:29597 Vue._update @ vendors.js:27069 updateComponent @ vendors.js:27190 get @ vendors.js:27603 Watcher @ vendors.js:27590 mountComponent @ vendors.js:27197 Vue.$mount @ vendors.js:31535 init @ vendors.js:26245 createComponent @ vendors.js:29098 createElm @ vendors.js:29045 addVnodes @ vendors.js:29226 patchVnode @ vendors.js:29445 patch @ vendors.js:29602 Vue._update @ vendors.js:27072 (anonymous) @ taro.js:4819 updateSync @ taro.js:4818 mount @ taro.js:4813 mount @ taro.js:4840 onLoad @ taro.js:4200 (anonymous) @ af-appx.worker.min.js:26 Tt @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 batchedUpdates @ af-appx.worker.min.js:26 executeUserFunction @ af-appx.worker.min.js:26 firePageEvent @ af-appx.worker.min.js:26 fireLegacyEvent @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 runBatch @ af-appx.worker.min.js:26 preload @ af-appx.worker.min.js:26 load @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 Cr @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 Promise.then (async) Ir @ af-appx.worker.min.js:26 Ar @ af-appx.worker.min.js:26 (anonymous) @ af-appx.worker.min.js:26 (anonymous) @ VM94 vendors.bundle.js:66 e.handleMessageFromRender4Init @ VM94 vendors.bundle.js:66 e.handleMessageFromRender @ VM94 vendors.bundle.js:66 e.postMessage @ VM94 vendors.bundle.js:51 e.handleAPI4PostMessage @ VM94 vendors.bundle.js:79 e.bridgeCall @ VM94 vendors.bundle.js:79 e.callBridgePluginAsyncInternal @ VM94 vendors.bundle.js:79 (anonymous) @ VM94 vendors.bundle.js:79 setTimeout (async) e.bridgeCall @ VM94 vendors.bundle.js:79 t.invokeBridgeAsync @ VM94 vendors.bundle.js:66 call @ VM94 vendors.bundle.js:51 postMessage @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 then @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 Pe @ VM2840 af-appx.min.js:13 mt @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 then @ VM2840 af-appx.min.js:13 (anonymous) @ VM2840 af-appx.min.js:13 vendors.js:23750 [Vue warn]: Invalid handler for event "contact": got undefined found in ---> at node_modules/_taro-ui-vue@1.0.0-beta.5@taro-ui-vue/src/components/button/index.vue at src/pages/wxcommon/index/index.vue **系统信息** Taro v3.0.17 Taro CLI 3.0.17 environment info: System: OS: Windows 10 Binaries: Node: 12.18.2 - C:\Program Files\nodejs\node.EXE npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD Taro UI Vue 版本: 1.0.0-beta.5 报错平台: alipay
FuYee commented 3 years ago

npm run build:alipay之后不会报错,但是npm run dev:alipay就会这个错