Skip to content

在router跳转前改变了state,跳转页面后,回退,页面状态未更新 #1324

@dsky1990

Description

@dsky1990

问题描述

在router跳转前改变了state,跳转页面后,回退,页面状态未更新

CODE

this.setState(Object.assign({}, {
          isSend: false,
          sendMsg: '获取验证码',
          mobileMatch: true,
          passwordMatch: true,
          isSbumit: false,
          smscodedMatch: true,
        }), () => {
          console.log('befor nav: ', this.state)
          Taro.navigateTo({
            url: `/pages/login/login`
          })
        })

console result
image

rotuer 返回的page状态

image

期望行为
期望行为:路由跳转回退后,页面按照state的状态更新

系统信息

  • 操作系统: [mac 10.12.6]
  • Taro 版本 [v1.1.9]
  • Node.js 版本 [v8.12.0]
  • 报错平台 [h5, weapp]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions