微信小程序返回上一页刷新组件数据

在父页面的onShow和onHide里面添加一个标志

onShow() {
        this.setData({
          show:true
      })
    },
    onHide() {
      this.setData({
        show:false
    })
    },

 把这个值传给子组件

<importantList slot="importantConcern" flag="{{barSelect}}" flag2="{{show}}" />

 在子组件的properties方法里面进行判断当flag2为true的时候调用刷新函数刷新

 properties: {
    flag: {
      type: String,
      observer: function(news) {
       if(news==='importantConcern'){
         this.getnewTablist(this.data.code)
       }
      }
    },
    flag2: {
      type: String,
      observer: function(news) {
       if(news==='true'&&news==='importantConcern'){
         this.getnewTablist(this.data.code)
       }
      }
    },
  },

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-10 17:36:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-10 17:36:03       100 阅读
  3. 在Django里面运行非项目文件

    2024-03-10 17:36:03       82 阅读
  4. Python语言-面向对象

    2024-03-10 17:36:03       91 阅读

热门阅读

  1. (科目三)数据库基础知识

    2024-03-10 17:36:03       52 阅读
  2. MySQL用户创建和权限分配

    2024-03-10 17:36:03       45 阅读
  3. uniapp的扩展组件uni-popup 弹出层自动打开

    2024-03-10 17:36:03       43 阅读
  4. 秒杀的时候怎么使用Redis?

    2024-03-10 17:36:03       39 阅读
  5. 第二十六章 :Docker 内部 DNS 服务如何使用

    2024-03-10 17:36:03       38 阅读
  6. 智慧路灯物联网解决方案

    2024-03-10 17:36:03       49 阅读
  7. 深入理解nginx负载均衡round-robin算法

    2024-03-10 17:36:03       41 阅读
  8. workflow系列教程(9)wfrest之mysql任务

    2024-03-10 17:36:03       35 阅读
  9. vue,provide和inject,备忘

    2024-03-10 17:36:03       46 阅读
  10. 硬件设计中数据运算相关处理方法

    2024-03-10 17:36:03       37 阅读