zoukankan      html  css  js  c++  java
  • mpvue应用之组件数据缓存清理

    main.ts

    Vue.mixin({
      // 监听页面加载
      onLoad() {
        this.componentShow = true;
      },
      // 监听页面卸载
      onUnload() {
        if (!this.$options.parent && this.$options.data) {
          this.componentShow = false;
          Object.assign(this.$data, this.$options.data());
        }
      },
    });

    页面中调用:

    <script lang="ts">
      private componentShow: boolean = false;
    </script>
    
    <Popup v-if="componentShow" 
    title="仓库记录" 
    :show="recordShow" 
    :content="buildingRecord" 
    @cancel="popupShow('recordShow')" 
    @confirm="recordConfirm"
     />

    参考链接:https://zhuanlan.zhihu.com/p/50759400

  • 相关阅读:
    forget word out4
    forget word out2
    forget words out1
    en_o out1
    en_e outtest2
    en_e out1
    疑难en_a
    en_a
    entest1
    铺音out2
  • 原文地址:https://www.cnblogs.com/ziyoublog/p/13261693.html
Copyright © 2011-2022 走看看