Skip to content

Commit

Permalink
fix(components): 修复 Picker 组件返回值问题
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjinjin0731 committed Jan 24, 2019
1 parent 2a4857d commit d1d965b
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions packages/taro-components/src/components/picker/index.js
Expand Up @@ -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)
}

// 点击取消或蒙层
Expand Down Expand Up @@ -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 值
Expand Down

0 comments on commit d1d965b

Please sign in to comment.