airyland / airyland/vux

[Bug Report] popup-picker为空时报错

Đang mở
#3,291 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Vue
Star
17.5k
Fork
3.6k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### VUX version
2.9.2

### OS/Browsers version
win10;chrome版本 69.0.3497.100(正式版本) (64 位)

### Vue version
2.5.18-beta.0

### Code

```html






import { PopupPicker, Group, Cell, XInput } from 'vux'
import apis from '@/apis'
export default {
components: {PopupPicker, Group, Cell, XInput},
data () {
return {
targetStation: '',
busList: [],
bus: []
}
},
methods: {
getTargetStation (value) {
this.busList = []
this.bus = []
this.$http.post(apis.MyTrafficBusTimeByTargetStationFirstSearch, {targetStationName: value}, {
headers: {
'X-XSRF-TOKEN': 'N2fVeoHNdMVRDtBJVdPG9Xlg%2BWvq%2Fsy1hcWA1Bg3dfszK4feE5g4RpmG9uQqeYj5.b67cc358169a4670a90513e094792e5e'
}
}).then(res => {
if (res.data.status === '200') {
if (res.data.data.records.length > 0) {
this.busList = res.data.data.records.map(item => {
return {
name: item.routeName,
value: item.id
}
})
}
}
})
},
busChange (val) {
this.$http.post(apis.MyTrafficBusTimeByRouteNameSecondSearch, {routeId: val.join(',')}, {
headers: {
'X-XSRF-TOKEN': 'N2fVeoHNdMVRDtBJVdPG9Xlg%2BWvq%2Fsy1hcWA1Bg3dfszK4feE5g4RpmG9uQqeYj5.b67cc358169a4670a90513e094792e5e'
}
}).then(res => {
if (res.data.status === '200') {

}
})
}
}
}

```

### Steps to reproduce
页面刷新

### What is Expected?
不报错

### What is actually happening?
vue.esm.js?efeb:591 [Vue warn]: Error in nextTick: "TypeError: Cannot read property 'value' of undefined"

found in

---> at node_modules/vux/src/components/picker/index.vue
at node_modules/vux/src/components/popup/index.vue
at node_modules/vux/src/components/popup-picker/index.vue
at node_modules/vux/src/components/group/index.vue
at src/pages/myBus.vue
at src/App.vue

warn @ vue.esm.js?efeb:591
logError @ vue.esm.js?efeb:1737
globalHandleError @ vue.esm.js?efeb:1732
handleError @ vue.esm.js?efeb:1721
(anonymous) @ vue.esm.js?efeb:1839
flushCallbacks @ vue.esm.js?efeb:1758
Promise.then (async)
microTimerFunc @ vue.esm.js?efeb:1806
nextTick @ vue.esm.js?efeb:1850
Vue.$nextTick @ vue.esm.js?efeb:4517
(anonymous) @ vue-router.esm.js?fe87:1978
step @ vue-router.esm.js?fe87:1706
step @ vue-router.esm.js?fe87:1713
runQueue @ vue-router.esm.js?fe87:1717
(anonymous) @ vue-router.esm.js?fe87:1971
step @ vue-router.esm.js?fe87:1706
(anonymous) @ vue-router.esm.js?fe87:1710
(anonymous) @ vue-router.esm.js?fe87:1956
(anonymous) @ vue-router.esm.js?fe87:1784
iterator @ vue-router.esm.js?fe87:1935
step @ vue-router.esm.js?fe87:1709
step @ vue-router.esm.js?fe87:1713
runQueue @ vue-router.esm.js?fe87:1717
confirmTransition @ vue-router.esm.js?fe87:1964
transitionTo @ vue-router.esm.js?fe87:1866
init @ vue-router.esm.js?fe87:2494
beforeCreate @ vue-router.esm.js?fe87:539
callHook @ vue.esm.js?efeb:2921
Vue._init @ vue.esm.js?efeb:4626
Vue @ vue.esm.js?efeb:4729
(anonymous) @ main.js?1c90:16
./src/main.js @ app.js:5710
__webpack_require__ @ app.js:679
fn @ app.js:89
0 @ app.js:5799
__webpack_require__ @ app.js:679
(anonymous) @ app.js:725
(anonymous) @ app.js:728
vue.esm.js?efeb:1741 TypeError: Cannot read property 'value' of undefined
at VueComponent.render (index.vue?6c15:79)
at VueComponent.eval (index.vue?6c15:34)
at Array.eval (vue.esm.js?efeb:1837)
at flushCallbacks (vue.esm.js?efeb:1758)

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.