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
我使用 PopupPicker
<popup-picker :show.sync="showTimePicker" :show-cell="false" :data="timeData" v-model="selectTime"> </popup-picker>
这是我的数据
timeData: [ [{name: "今天", value: 0}, {name: "明天", value: 1}], ['00点', '01点', '02点', '03点', '04点', '05点', '06点', '07点', '08点', '09点', '10点', '11点', '12点', '13点', '14点', '15点', '16点', '17点', '18点', '19点', '20点', '21点', '22点', '23点'], ['00分', '15分', '30分', '45分'] ], selectTime: [],
然后我监测selectTime的变化时发现,如果弹出框不去动第一列,那么selectTime的第一个item会是一个object。。。。
selectTime
如果动了第一列,就成字符串了。。。。
PS:我试过timeData里的item全用{name,value}的形势,结果一样
timeData
The text was updated successfully, but these errors were encountered:
补充:只要动过第一列,以后的就都是字符串了
Sorry, something went wrong.
请确保列表项的value值是字符串,使用数字会出错。
@joy-yu
还真是这样。。。。
好吧,这就有点蛋疼了。。因为我这PopupPicker设置的“今天”、“明天”,展示的时候也要是“今天”、“明天”,最后取值的时候却需要一个日期。。
PopupPicker
“今天”、“明天”
所以我想到的另起一个timeConvert:[{date:'2017-9-27',dateText:'今天'}]这样的数组,然后将PopupPicker的value设置成timeConvert的index,到时候在timeConvert里头去取要用的值。。。。
timeConvert:[{date:'2017-9-27',dateText:'今天'}]
value
timeConvert
index
文档有注明,目前只支持字符串值。至于取值和展示值确实需要自行转换了。
No branches or pull requests
我使用 PopupPicker
这是我的数据
然后我监测
selectTime
的变化时发现,如果弹出框不去动第一列,那么selectTime
的第一个item会是一个object。。。。如果动了第一列,就成字符串了。。。。
PS:我试过
timeData
里的item全用{name,value}的形势,结果一样The text was updated successfully, but these errors were encountered: