赞
踩
在父页面的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)
- }
- }
- },
- },
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。