Skip to content

Commit

Permalink
fix(taro-weapp): state 与 props 优先级
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Jul 31, 2018
1 parent 8239556 commit de7db67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/taro-weapp/src/lifecycle.js
Expand Up @@ -43,14 +43,14 @@ export function updateComponent (component) {
}

function doUpdate (component) {
const {state, props = {}} = component
const { state, props = {} } = component
let data = state || {}
if (component._createData) {
data = component._createData(state, props)
}
let privatePropKeyVal = component.$scope.data[privatePropKeyName] || false

data = Object.assign(data, props)
data = Object.assign({}, props, data)
if (component.$usedState && component.$usedState.length) {
const _data = {}
component.$usedState.forEach(key => {
Expand Down

0 comments on commit de7db67

Please sign in to comment.