在微信小程序中,bindload 是一个事件绑定属性,但它主要用于 web-view 组件和 image 组件,而不是 input 组件(微信小程序bindload)。 在 web-view 组件中使用 bindloadweb-view 组件用于加载网页内容。当网页加载完成时,会触发 bindload 事件。你可以在 wxml 文件中为 web-view 组件添加 bindload 事件,并在对应的 js 文件中处理该事件。示例:xml!-- index.wxml -- web-view src={{webview_url}} bindload=getCurUrl/web-viewjavascript// index.js Page({ data: { webview_url: 'https://example.com' }, getCurUrl(e)
2024-05-14