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

AtAccordion这个组件,我在微信开发工具使用没问题。怎么真机预览,就不能伸缩了。版本都是最新的。 #513

Closed
xuzihaojoe opened this issue Feb 17, 2019 · 4 comments
Labels
question Further information is requested

Comments

@xuzihaojoe
Copy link

问题描述
就是更新了taro-ui的版本之后,之前是用1.5.3
AtAccordion这个taro-ui的组件使用有问题。
在微信开发工具测试没有问题,但是真机预览就无法展开AtAccordion的内容
并没有出现报错信息

复现步骤
[复现问题的步骤]

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

[或者可以直接贴源代码,能贴文字就不要截图]


```import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import { AtAccordion,AtList, AtListItem } from 'taro-ui'
export default class Test extends Component {

  config = {
    navigationBarTitleText: 'test'
  }

  constructor () {
    super(...arguments)
    this.state = {
      open:false
    }
  }
  handleClick (value) {
    this.setState({
      open: value
    });
  }
  render () {
    return (
      <View className='test'>
        <View>{this.state.may}</View>
        <AtAccordion
        open={this.state.open}
        onClick={this.handleClick.bind(this)}
        title='标题一'
      >
        <AtList hasBorder={false}>
          <AtListItem
            title='标题文字'
            arrow='right'
            thumb='https://img12.360buyimg.com/jdphoto/s72x72_jfs/t6160/14/2008729947/2754/7d512a86/595c3aeeNa89ddf71.png'
          />
        </AtList>
      </AtAccordion>
      </View>
    )
  }
}



**期望行为**
就是真机预览可以让组件可以展开内容

**报错信息**

[这里请贴上你的**完整**报错截图或文字]
微信开发工具可以的:
![image](https://user-images.githubusercontent.com/40189691/52909487-15aaba80-32c4-11e9-93e6-2fb3f18c7684.png)
手机上不可以的:
![image](https://user-images.githubusercontent.com/40189691/52909498-47238600-32c4-11e9-97ac-3f369302c63b.png)


**系统信息**
> Taro v1.2 及以上版本已添加 `taro info` 命令,方便大家查看系统及依赖信息,运行该命令后将结果贴下面即可。
taro info
👽 Taro v1.2.13


  Taro CLI 1.2.13 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 10.14.1 - C:\Program Files\nodejs\node.EXE
      npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
 - 操作系统: [e.g. Windows 10]
 - Taro 版本 [e.g. v.0.0.64]
 - Node.js 版本 [e.g. v9.0.0]
 - taro-ui 2.0.0
 - 报错平台 [weapp]
**补充信息**
[可选]
[根据你的调查研究,出现这个问题的原因可能在哪里?]
@taro-bot
Copy link

taro-bot bot commented Feb 17, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@yuche yuche transferred this issue from NervJS/taro Apr 8, 2019
@kennylbj
Copy link

kennylbj commented Apr 8, 2019

我这也无法折叠或者打开

@jimczj
Copy link
Contributor

jimczj commented Apr 9, 2019

使用 Taro UI 2.0.2,该问题已修复

@jimczj jimczj added the question Further information is requested label Apr 9, 2019
@kennylbj
Copy link

当前AtAccordion是个受控组件,展开关闭需要根据open属性决定。但是多数场景是用户不希望自己控制open,只需点击打开,再点击就关闭。

建议将AtAccordion改为非受控和受控组件的结合,在未传入open属性时,表现为非受控组件;在传入open时,表现为受控组件。

参照Input组件。

@jimczj jimczj closed this as completed Jun 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants