Skip to content
Permalink
Browse files

fix(components): 修复 Picker 组件返回值问题

  • Loading branch information...
jinjinjin0731 committed Jan 24, 2019
1 parent 2a4857d commit d1d965b34ed888c0cd19918bf39b31b37aa6015a
Showing with 12 additions and 9 deletions.
  1. +12 −9 packages/taro-components/src/components/picker/index.js
@@ -292,8 +292,7 @@ export default class Picker extends Nerv.Component {
pickerValue: eventObj.detail.value
})

let reEventObj = Object.assign({}, eventObj)
this.props.onChange && this.props.onChange(reEventObj)
this.props.onChange && this.props.onChange(eventObj)
}

// 点击取消或蒙层
@@ -332,13 +331,17 @@ export default class Picker extends Nerv.Component {

// 统一抛出的事件对象,和小程序对齐
const getEventObj = (e, type, detail) => {
return {
currentTarget: e.target,
detail,
target: e.target,
timeStamp: Math.floor(e.timeStamp),
type
}
Object.defineProperties(e, {
detail: {
value: detail,
enumerable: true
},
type: {
value: type,
enumerable: true
}
})
return e
}

// 供 PickerGroup 修改对应的 height 值

0 comments on commit d1d965b

Please sign in to comment.
You can’t perform that action at this time.