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

Form中button 位置偏右 #158

Closed
nyrf opened this issue Nov 7, 2018 · 2 comments
Closed

Form中button 位置偏右 #158

nyrf opened this issue Nov 7, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@nyrf
Copy link

nyrf commented Nov 7, 2018

重现步骤

import Taro, { Component } from '@tarojs/taro'
import { AtForm, AtInput, AtButton } from 'taro-ui'

class Login extends Component {
  constructor () {
    super(...arguments)
    this.state = {
      mobile: '',
      password: ''
    }
  }
  mobileChange (value) {
    this.setState({
      mobile: value
    })
  }

  passwordChange (value) {
    this.setState({
      password: value
    })
  }

  onSubmit (event) {
    console.log(event)
    console.log(this.state)
  }
  onReset (event) {
    console.log(event)
  }

  render () {
    return (
      <AtForm
        onSubmit={this.onSubmit.bind(this)}
        onReset={this.onReset.bind(this)}
      >
        <AtInput
          name='mobile'
          title='手机号'
          type='phone'
          placeholder='输入手机号'
          value={this.state.mobile}
          onChange={this.mobileChange.bind(this)}
        />
        <AtInput
          name='password'
          title='密码'
          type='password'
          placeholder='输入密码'
          value={this.state.password}
          onChange={this.passwordChange.bind(this)}
        />
        <AtButton formType='submit' type="primary">提交</AtButton>
        <AtButton formType='reset'>重置</AtButton>
      </AtForm>
    )
  }
}

依赖的版本号

node: v10.13.0, Taro: 1.1.1 Taro-UI: 1.3.5

预期结果

Button 居中

实际结果

下面两个按钮偏右了,如果把form换成View,就居中了

wx20181107-095017 2x

相关链接

@jimczj jimczj added the enhancement New feature or request label Nov 7, 2018
@jimczj
Copy link
Contributor

jimczj commented Nov 7, 2018

确实有这个问题,近期会将 form 与 input 进行调整

@jimczj jimczj self-assigned this Nov 8, 2018
@koppthe
Copy link
Collaborator

koppthe commented Jan 3, 2019

这个计划增加 Cell 组件来解决,不在 form 组件中加样式

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants