-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
PickerViewColumn 使用提示路径错误 #562
Comments
贴一下文件的代码 |
import Taro, { Component } from '@tarojs/taro'
import { View, PickerView, PickerViewColumn } from '@tarojs/components'
export default class Picks extends Component {
constructor() {
super(...arguments)
const date = new Date()
const years = []
const months = []
const days = []
for (let i = 1990; i <= date.getFullYear(); i++) {
years.push(i)
}
for (let i = 1; i <= 12; i++) {
months.push(i)
}
for (let i = 1; i <= 31; i++) {
days.push(i)
}
this.state = {
years: years,
year: date.getFullYear(),
months: months,
month: 2,
days: days,
day: 2,
value: [9999, 1, 1],
}
}
onChange = e => {
const val = e.detail.value
this.setState({
year: this.state.years[val[0]],
month: this.state.months[val[1]],
day: this.state.days[val[2]],
value: val
})
}
render() {
return (
<View>
<View>{this.state.year}年{this.state.month}月{this.state.day}日</View>
<PickerView indicatorStyle="height: 50px;" style="width: 100%; height: 300px;" value={this.state.value} onChange={this.onChange}>
<PickerViewColumn>
{this.state.years.map(item => {
return (
<View>{item}年</View>
);
})}
</PickerViewColumn>
<PickerViewColumn>
{this.state.months.map(item => {
return (
<View>{item}月</View>
);
})}
</PickerViewColumn>
<PickerViewColumn>
{this.state.days.map(item => {
return (
<View>{item}日</View>
);
})}
</PickerViewColumn>
</PickerView>
</View>
)
}
} |
已修复,下个版本发布~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题描述
引入PickerView,PickerViewColumn同时使用会出现这个问题
copy 官网示例代码也出现这个问题~
复现步骤
具体看taro 示例代码
期望行为
报错信息
系统信息
补充信息
[可选]
[根据你的调查研究,出现这个问题的原因可能在哪里?]
The text was updated successfully, but these errors were encountered: