Skip to content

关于支付宝小程序的 webview 组件问题 #2

Open
@zwwill

Description

@zwwill

doc: https://docs.alipay.com/mini/component/web-view
问题:

<web-view src="{{url}}" onMessage="onmessage"></web-view>
Page({
  data: {
    url: 'xxx' 
  },
  onLoad() {
    this.setData({ url: 'aaa' }) // 有效
  },
  onReady() {
    this.setData({ url: 'bbb' }) // 无效
  }
})

如上demo,组件 <web-view> 在 lifecycle 的 onReady 在更新 url 将无法控制 webview 的网页内容。

此问题是基于架构做的取舍,还是存在的一个可修复问题?后期是否会更改

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions