6***@qq.com
6***@qq.com
  • 发布:2021-04-23 12:39
  • 更新:2022-12-09 14:35
  • 阅读:2240

uniapp webview 给src动态传参,src地址没变化

分类:uni-app

uniapp webview 给src动态传参,src地址没变化

2021-04-23 12:39 负责人:无 分享
已邀请:
x***@163.com

x***@163.com - D_and_D

碰到同样的问题,接口返回数据比webview渲染更慢,等接口返回了数据,webview已经出现了,src更新不了,你是怎么解决的

明明就是我

明明就是我

有没有什么办法,src不变,通知html更新的?

清茶涩

清茶涩

先if一下webview组件,接口回来了再设置显示 <web-view v-if="url" src="url">

  • 1***@qq.com

    没有用啊,一开始没显示,后面改变了他也不显示了

    2021-12-23 11:51

1***@qq.com

1***@qq.com

<view v-if="show">
<web-view :src="url"></web-view>
</view>

    methods: {  
        open(){  
            const tui = this.tui;  
                tui.request(tui.url.getWxJumpUrl(this.shortLink), {}, true, "GET").then((result) => {  
                    if (result.code == 200) {  
                        this.url = result.msg  
                        this.$nextTick(() => {  
                            this.show = true;  
                        })  
                    } else {  
                        uni.showToast({  
                            title: '链接已失效',  
                            icon: 'none'  
                        })  
                    }  
                })  
        }  
    }   

我的是从后台查询拿到url再赋值,使用this.$nextTick

1***@163.com

1***@163.com

src参数改变我是用v-if 更新的。。。。。

要回复问题请先登录注册