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

神奇的bug #2046

Closed
KarnaughK opened this issue Sep 27, 2017 · 4 comments
Closed

神奇的bug #2046

KarnaughK opened this issue Sep 27, 2017 · 4 comments

Comments

@KarnaughK
Copy link

我使用 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。。。。
image

如果动了第一列,就成字符串了。。。。
image

PS:我试过timeData里的item全用{name,value}的形势,结果一样

@KarnaughK
Copy link
Author

补充:只要动过第一列,以后的就都是字符串了

@joy-yu
Copy link

joy-yu commented Sep 27, 2017

请确保列表项的value值是字符串,使用数字会出错。

@KarnaughK
Copy link
Author

@joy-yu

还真是这样。。。。

好吧,这就有点蛋疼了。。因为我这PopupPicker设置的“今天”、“明天”,展示的时候也要是“今天”、“明天”,最后取值的时候却需要一个日期。。

所以我想到的另起一个timeConvert:[{date:'2017-9-27',dateText:'今天'}]这样的数组,然后将PopupPickervalue设置成timeConvertindex,到时候在timeConvert里头去取要用的值。。。。

@airyland
Copy link
Owner

文档有注明,目前只支持字符串值。至于取值和展示值确实需要自行转换了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants