Skip to content
New issue

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

Button 组件在开启 Loading 状态后的样式异常 #452

Closed
1 of 7 tasks
TaroXin opened this issue Feb 5, 2023 · 0 comments
Closed
1 of 7 tasks

Button 组件在开启 Loading 状态后的样式异常 #452

TaroXin opened this issue Feb 5, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@TaroXin
Copy link

TaroXin commented Feb 5, 2023

这个 Issue 涉及以下平台:

  • 微信小程序
  • 支付宝小程序
  • 百度小程序
  • 头条小程序
  • 快手小程序
  • QQ 轻应用
  • Web 平台(H5)

BUG 描述
两个 Button 在同一个行中出现,其中一个 Button 开启 Loading,样式出现问题

复现步骤

import { View } from '@tarojs/components'
import { Button } from '@antmjs/vantui'
import { useState } from 'react'
import './index.less'

export default function Index() {
  const [count, setCount] = useState(0)
  const [buttonLoading, setLoading] = useState(false)

  function changeCount(num: number) {
    setCount(count + num)
    setLoading(true)
    setTimeout(() => {
      setLoading(false)
    }, 2000)
  }

  return (
    <View className='index'>
      <View>count: { count }</View>

      <View>
        <Button onClick={() => changeCount(1)} type="warning" loading={buttonLoading} loadingText="正在加载...">+</Button>
        <Button onClick={() => changeCount(-1)} type="primary">-</Button>
      </View>
    </View>
  )
}

截图
未命名

环境
Taro CLI 3.6.0 environment info:
System:
OS: macOS 12.6
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.19.0/bin/yarn
npm: 8.19.3 - ~/.nvm/versions/node/v16.19.0/bin/npm
npmPackages:
@tarojs/cli: 3.6.0 => 3.6.0
@tarojs/components: 3.6.0 => 3.6.0
@tarojs/helper: 3.6.0 => 3.6.0
@tarojs/plugin-framework-react: 3.6.0 => 3.6.0
@tarojs/plugin-platform-alipay: 3.6.0 => 3.6.0
@tarojs/plugin-platform-h5: 3.6.0 => 3.6.0
@tarojs/plugin-platform-jd: 3.6.0 => 3.6.0
@tarojs/plugin-platform-qq: 3.6.0 => 3.6.0
@tarojs/plugin-platform-swan: 3.6.0 => 3.6.0
@tarojs/plugin-platform-tt: 3.6.0 => 3.6.0
@tarojs/plugin-platform-weapp: 3.6.0 => 3.6.0
@tarojs/react: 3.6.0 => 3.6.0
@tarojs/runtime: 3.6.0 => 3.6.0
@tarojs/shared: 3.6.0 => 3.6.0
@tarojs/taro: 3.6.0 => 3.6.0
@tarojs/webpack5-runner: 3.6.0 => 3.6.0
babel-preset-taro: 3.6.0 => 3.6.0
eslint-config-taro: 3.6.0 => 3.6.0
react: ^18.0.0 => 18.2.0

附加信息

@zuolung zuolung added the bug Something isn't working label Feb 6, 2023
@zuolung zuolung closed this as completed Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants