Skip to content

Commit

Permalink
fix(taro-weapp): Taro warn 在微信内的兼容性问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksleo committed Aug 13, 2018
1 parent fb9f084 commit 7b1e4cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-weapp/src/create-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function createComponent (ComponentClass, isPage) {
try {
componentInstance.state = componentInstance._createData()
} catch (err) {
const errLine = /at\s(.*\))/.exec(err.stack.toString())[1] || ''
const errLine = err.stack.toString().split(/\n/)[2] || ''
console.warn(`[Taro warn]
${err.message}
${errLine}: 请给组件提供一个 \`defaultProps\` 以提高初次渲染性能!`)
Expand Down

0 comments on commit 7b1e4cf

Please sign in to comment.