Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

小白求教,store中的data不会随页面卸载而重置吗 #54

Closed
zhcode-fun opened this issue Nov 13, 2018 · 1 comment
Closed

Comments

@zhcode-fun
Copy link

比如

  • store.js里面
data: {
    arr: []
}
  • 页面index.js里面
create(store,{
    data: {
        arr: null
    }
})

当arr添加元素后退出该页面,再进来之前添加的元素还在,不会重置为初始值
这是正常现象吗

详细代码片段:https://developers.weixin.qq.com/s/LJwbWTmi7M35

ps:我知道arr放在页面的data中就行了,可我想用diff,只放页面data中更新时就不会经过diff了

@dntzhang
Copy link
Collaborator

正常,不会重置。要重置请手动重置(onShow onHide什么的)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants