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
#6087
import {View, Picker} from '@tarojs/components' class StoreManage extends Component { constructor(props) { super(props); this.state = { area: [ { areaName: '杭州' },{ areaName: '上海' } ] } } render() { const {area} = this.state; return ( <Picker mode='selector' disabled={area.length === 0} range={area} range-key='areaName' > </Picker> ) } } export default StoreManage
但如果我使用这种方式,又是可以的
// 先去获取disabled的值
render() { const {area} = this.state; const disabled = area.length === 0// 先去获取disabled的值 return ( <Picker mode='selector' disabled={disabled} range={area} range-key='areaName' > </Picker> ) } }
希望动态的添加disabled属性可以生效;
没有报错,但就是没效果
👽 Taro v2.1.3
Taro CLI 2.1.3 environment info: System: OS: macOS 10.15.4 Shell: 3.2.57 - /bin/bash Binaries: Node: 12.13.0 - /usr/local/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 6.12.0 - /usr/local/bin/npm npmPackages: @tarojs/components: 2.1.3 => 2.1.3 @tarojs/components-qa: 2.1.3 => 2.1.3 @tarojs/mini-runner: 2.1.3 => 2.1.3 @tarojs/redux: 2.1.3 => 2.1.3 @tarojs/redux-h5: 2.1.3 => 2.1.3 @tarojs/router: 2.1.3 => 2.1.3 @tarojs/taro: 2.1.3 => 2.1.3 @tarojs/taro-alipay: 2.1.3 => 2.1.3 @tarojs/taro-h5: 2.1.3 => 2.1.3 @tarojs/taro-qq: 2.1.3 => 2.1.3 @tarojs/taro-quickapp: 2.1.3 => 2.1.3 @tarojs/taro-swan: 2.1.3 => 2.1.3 @tarojs/taro-tt: 2.1.3 => 2.1.3 @tarojs/taro-weapp: 2.1.3 => 2.1.3 @tarojs/webpack-runner: 2.1.3 => 2.1.3 eslint-config-taro: 2.1.3 => 2.1.3 eslint-plugin-taro: 2.1.3 => 2.1.3 nerv-devtools: ^1.5.5 => 1.5.6 nervjs: ^1.5.5 => 1.5.6 stylelint-config-taro-rn: 2.1.3 => 2.1.3 stylelint-taro-rn: 2.1.3 => 2.1.3 taro-ui: ^2.3.3 => 2.3.3
The text was updated successfully, but these errors were encountered:
CC @Chen-jj
Sorry, something went wrong.
欢迎提交 Issue~
如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏
如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。
Good luck and happy coding~
@wforguo 微信的锅,length 在按路径 setData 时不会更新。所以不能直接用 length 做判断,用你的写法 2 绕过咯。
http://taro-docs-in.jd.com/taro/docs/debug.html#%E6%B2%A1%E6%9C%89%E4%BB%BB%E4%BD%95%E6%8A%A5%E9%94%99%EF%BC%8C%E4%BD%86%E6%98%BE%E7%A4%BA%E7%9A%84%E7%BB%93%E6%9E%9C%E4%B8%8D%E5%A6%82%E9%A2%84%E6%9C%9F
Hello~
您的问题楼上已经有了确切的回答,如果没有更多的问题这个 issue 将在 15 天后被自动关闭。
如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。
好的,了解,感谢
Chen-jj
No branches or pull requests
#6087
问题描述
复现步骤
但如果我使用这种方式,又是可以的
// 先去获取disabled的值
期望行为
希望动态的添加disabled属性可以生效;
报错信息
没有报错,但就是没效果
系统信息
👽 Taro v2.1.3
Taro CLI 2.1.3 environment info:
System:
OS: macOS 10.15.4
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.13.0 - /usr/local/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.12.0 - /usr/local/bin/npm
npmPackages:
@tarojs/components: 2.1.3 => 2.1.3
@tarojs/components-qa: 2.1.3 => 2.1.3
@tarojs/mini-runner: 2.1.3 => 2.1.3
@tarojs/redux: 2.1.3 => 2.1.3
@tarojs/redux-h5: 2.1.3 => 2.1.3
@tarojs/router: 2.1.3 => 2.1.3
@tarojs/taro: 2.1.3 => 2.1.3
@tarojs/taro-alipay: 2.1.3 => 2.1.3
@tarojs/taro-h5: 2.1.3 => 2.1.3
@tarojs/taro-qq: 2.1.3 => 2.1.3
@tarojs/taro-quickapp: 2.1.3 => 2.1.3
@tarojs/taro-swan: 2.1.3 => 2.1.3
@tarojs/taro-tt: 2.1.3 => 2.1.3
@tarojs/taro-weapp: 2.1.3 => 2.1.3
@tarojs/webpack-runner: 2.1.3 => 2.1.3
eslint-config-taro: 2.1.3 => 2.1.3
eslint-plugin-taro: 2.1.3 => 2.1.3
nerv-devtools: ^1.5.5 => 1.5.6
nervjs: ^1.5.5 => 1.5.6
stylelint-config-taro-rn: 2.1.3 => 2.1.3
stylelint-taro-rn: 2.1.3 => 2.1.3
taro-ui: ^2.3.3 => 2.3.3
补充信息
没有报错,但就是没效果
The text was updated successfully, but these errors were encountered: