We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
支付宝小程序
https://gitee.com/yamlling_admin/taro-react-taroui.git 小程序基础库: 2.9.30 使用框架: React
逻辑代码 ` const login = () => {
if (!checked) { showToast({ title: '请先同意用户协议', icon: 'none', duration: 2000 }) return } if (!mobile) { showToast({ title: '请输入手机号码', icon: 'none', duration: 2000 }) return } if (login_type === '短信登录') { if (!checkCode) { showToast({ title: '请输入验证码', icon: 'none', duration: 2000 }) return } } if (login_type === '账号登录') { if (!password) { showToast({ title: '请输入密码', icon: 'none', duration: 2000 }) return } // 检测密码只能为数字和英文字母 let reg = /^[A-Za-z0-9]+$/ if (!reg.test(password)) { showToast({ title: '密码只能为数字和英文字母', icon: 'none', duration: 2000 }) } } mobileLogin({ mobile, checkCode, password, loginType: login_type === '短信登录' ? 2 : 1, custLoginName: mobile, }) .then(async res => { await product_car_info({ size: 10, current: 1 }).then(res => { let num = res.data.total dispatch('car', { type: 'SET_CAR', payload: { num: num } }) }); reLaunch({ url: '/pages/login-result/index' }) }) .catch(err => { if (err.msg == '业务异常: 会员密码不正确,请重新登录或选用其他方式登录') { showToast({ title: '账号密码错误', icon: 'error', duration: 2000 }) } else { showToast({ title: err.msg, icon: 'error', duration: 2000 }) } })
} `
模板代码 <View className="btn mt-[42px] mb-[54px] flex justify-center items-center bg-def color-black" onClick={login} > 登录 </View>
<View className="btn mt-[42px] mb-[54px] flex justify-center items-center bg-def color-black" onClick={login} > 登录 </View>
能正常触发点击事件
无法触发点击事件
👽 Taro v4.0.7 Taro CLI 4.0.7 environment info: System: OS: Windows 11 10.0.26100 Binaries: Node: 18.20.4 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD npmPackages: @tarojs/cli: 4.0.7 => 4.0.7 @tarojs/components: 4.0.7 => 4.0.7 @tarojs/helper: 4.0.7 => 4.0.7 @tarojs/plugin-framework-react: 4.0.7 => 4.0.7 @tarojs/plugin-platform-alipay: 4.0.7 => 4.0.7 @tarojs/plugin-platform-h5: 4.0.7 => 4.0.7 @tarojs/plugin-platform-harmony-hybrid: 4.0.7 => 4.0.7 @tarojs/plugin-platform-jd: 4.0.7 => 4.0.7 @tarojs/plugin-platform-qq: 4.0.7 => 4.0.7 @tarojs/plugin-platform-swan: 4.0.7 => 4.0.7 @tarojs/plugin-platform-tt: 4.0.7 => 4.0.7 @tarojs/plugin-platform-weapp: 4.0.7 => 4.0.7 @tarojs/react: 4.0.7 => 4.0.7 @tarojs/runtime: 4.0.7 => 4.0.7 @tarojs/shared: 4.0.7 => 4.0.7 @tarojs/taro: 4.0.7 => 4.0.7 @tarojs/taro-loader: 4.0.7 => 4.0.7 @tarojs/webpack5-runner: 4.0.7 => 4.0.7 babel-preset-taro: 4.0.7 => 4.0.7 eslint-config-taro: 4.0.7 => 4.0.7 react: ^18.0.0 => 18.3.1
Button组件能正常触发点击事件
The text was updated successfully, but these errors were encountered:
尝试过后发现Text Button 等组件都能正常出发onClick 唯独常规容器View不可以
Sorry, something went wrong.
fix(clickview): 修复支付宝view点击事件失效问题&完善click-view相关逻辑 #16812
d1c96b1
tutuxxx
No branches or pull requests
相关平台
支付宝小程序
复现仓库
https://gitee.com/yamlling_admin/taro-react-taroui.git
小程序基础库: 2.9.30
使用框架: React
复现步骤
逻辑代码
`
const login = () => {
}
`
模板代码
<View className="btn mt-[42px] mb-[54px] flex justify-center items-center bg-def color-black" onClick={login} > 登录 </View>
期望结果
能正常触发点击事件
实际结果
无法触发点击事件
环境信息
补充信息
Button组件能正常触发点击事件
The text was updated successfully, but these errors were encountered: