美文网首页
react dva学习中调试

react dva学习中调试

作者: 第2世界 | 来源:发表于2020-01-12 22:19 被阅读0次

调试使用console.log(this.props);可以打印出当前的属性。

state到底是什么

@connect((state)=>(state))可以打印出state这个对象

{history: {…}, location: {…}, match: {…}, staticContext: undefined, computedMatch: {…}, …}
history: {length: 2, action: "POP", location: {…}, createHref: ƒ, push: ƒ, …}
location: {pathname: "/test", search: "", hash: "", query: {…}, state: undefined}
match: {path: "/test", url: "/test", isExact: true, params: {…}}
staticContext: undefined
computedMatch: {path: "/test", url: "/test", isExact: true, params: {…}}
route: {path: "/test", exact: true, component: ƒ}
children: null
router: {location: {…}, action: "POP"}
@@dva: 0
global: {collapsed: false, notices: Array(0)}
login: {status: undefined}
settings: {navTheme: "dark", primaryColor: "daybreak", layout: "sidemenu", contentWidth: "Fluid", fixedHeader: false, …}
user: {currentUser: {…}}
loading: {global: false, models: {…}, effects: {…}}
test: {status: 0}
dispatch: ƒ (action)
proto: Object

相关文章

网友评论

      本文标题:react dva学习中调试

      本文链接:https://www.haomeiwen.com/subject/utiwactx.html