Skip to content

Commit

Permalink
fix(rn): this.$router增加path属性,与形式小程序同步
Browse files Browse the repository at this point in the history
  • Loading branch information
WaterMan authored and cncolder committed Mar 3, 2020
1 parent f44d94c commit 17549d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/taro-rn/src/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Component extends React.Component {
constructor (props, context) {
super(props, context)
if (props.navigation) {
this.$router = {params: props.navigation.state.params || {}, path: props.navigation.routeName ? ('/' + props.navigation.routeName) : null}
this.$router = {params: props.navigation.state.params || {}, path: props.navigation.state.routeName ? ('/' + props.navigation.state.routeName) : null}
}
}

Expand All @@ -25,7 +25,7 @@ class PureComponent extends React.PureComponent {
constructor (props, context) {
super(props, context)
if (props.navigation) {
this.$router = {params: props.navigation.state.params || {}, path: props.navigation.routeName ? ('/' + props.navigation.routeName) : null}
this.$router = {params: props.navigation.state.params || {}, path: props.navigation.state.routeName ? ('/' + props.navigation.state.routeName) : null}
}
}

Expand Down

0 comments on commit 17549d6

Please sign in to comment.