3***@qq.com
3***@qq.com
  • 发布:2023-01-19 21:08
  • 更新:2023-01-21 11:15
  • 阅读:194

页面跳转返回后数据错误问题

分类:uni-app
<template>  
    <view >  
        {{tsid}}  

        <view @click="toUrl('/pages/index/custom?id=2',1)">  
            123  
        </view>  

    </view>  
</template>  

<script>  
       var _self ;  
    export default {  
        data() {  
                return {  

                            tsid:0  
                        };  
        },  
            onLoad(e) {  
                    _self = this;  
                    _self.id = e.id;  
                },  
                onShow(){  

                    this.page={};  
                    this.tsid=0;  
                    _self.getdata();  

                },  
        methods: {  
                    getinfo(){  
                      console.log(_self.page.data)  
                    },  
                    getdata(){  
                        var self =this;  
                        self.tsid=1  
                        console.log(self.tsid)  

                    },  
                        toUrl(url,type){  

                            var res =false ;  
                            if(type==0){  
                                res=  uni.redirectTo({  
                                    url: url  
                                });  
                            }else if(type==1){  
                                res=  uni.navigateTo({  
                                    url: url  
                                });  
                            }else if(type==2){  
                                uni.switchTab({  
                                    url: url  
                                })  
                            }  

                        },  

                },  
    }  
</script>  
2023-01-19 21:08 负责人:无 分享
已邀请:
YUANRJ

YUANRJ

什么错误?请详细描述下你的问题

该问题目前已经被锁定, 无法添加新回复