We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
原生支付宝小程序在使用 web-view 组件时,src 属性只能在,页面初次渲染完成前进行更新。即必须在 onReady 触发以前。
web-view
src
onReady
<web-view src="{{url}}" onMessage="onmessage"></web-view>
Page({ data: { url: 'xxx' // 有效 }, onLoad() { this.setData({ url: 'aaa' }) // 有效 }, onReady() { this.setData({ url: 'bbb' }) // 无效 } })
目前,megalo 的 $mount 的触发时机是在 onReady 触发时,此时才会首次将 vnode 上的数据同步到小程序视图层,使得 web-view 的 src 无法修改。
$mount
vnode
onLoad
The text was updated successfully, but these errors were encountered:
megalo@0.3.0 @megalo/template-compiler@0.3.0
Sorry, something went wrong.
elcarim5efil
No branches or pull requests
原生支付宝小程序在使用
web-view
组件时,src
属性只能在,页面初次渲染完成前进行更新。即必须在onReady
触发以前。目前,megalo 的
$mount
的触发时机是在onReady
触发时,此时才会首次将vnode
上的数据同步到小程序视图层,使得web-view
的src
无法修改。onLoad
阶段。本身不需要操作 DOM 节点,只是同步数据,所以实现上将$mount
提前到onLoad
阶段执行是没什么问题的,但这样的修改会改变生命周期钩子的顺序(onLoad -> created -> mounted -> onReady)。有待验证其影响。The text was updated successfully, but these errors were encountered: