Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zwwill opened this issue Nov 1, 2018 · 3 comments
Open

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

zwwill opened this issue Nov 1, 2018 · 3 comments

Comments

@zwwill
Copy link
Member

zwwill commented Nov 1, 2018

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 的网页内容。

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

@zwwill
Copy link
Member Author

zwwill commented Nov 1, 2018

相关问题 kaola-fed/megalo#18

@anhuiliujun
Copy link

onReady中都也支持的。如果确定有问题,请帮我们提供下复现路径。

@zwwill
Copy link
Member Author

zwwill commented Nov 2, 2018

Page({
  data: {
    url: '' 
  },
  onLoad() {
  },
  onReady() {
    this.setData({ url: 'https://www.baidu.com' }) 
  }
})

这样写就没有效果的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants