zoukankan      html  css  js  c++  java
  • 在react native中使用mobx时初始化页面数据

    1.说明:在react native中使用mobx时退出当前页面后,重新进入该页面时,初始化页面数据(多用于当前页面有筛选条件时,退出页面后mobx中数据保留筛选后的状态)

    2直接上代码:

    class xxxxx extends PureComponent {
    constructor(props) {
    super(props);
    store.xxxxxx();
    this.state = {
    };
    }
    componentWillMount() {
    store.yyyyy= xxxxx; //yyyyy代表你mobx中观测的变量, xxxxx代表你想初始化的值
    store.yyyyy= xxxxx;
    }
    }
  • 相关阅读:
    【leetcode】1230.Toss Strange Coins
    2018.12.25 SOW
    L203 词汇题
    L202
    L201
    L200
    2018
    2018.12.21 Cmos- RF
    L198
    L196 Hospital educations
  • 原文地址:https://www.cnblogs.com/zhuyupingit/p/7611581.html
Copyright © 2011-2022 走看看