UNPKG

@tarojs/components

Version:
26 lines (22 loc) 784 B
import { r as registerInstance, c as createEvent, h } from './index-ab3c86da.js'; const indexCss = "iframe{border:none}.taro-webview{z-index:999;width:100%;height:100%;position:fixed;top:0;bottom:0}"; const WebView = class { constructor(hostRef) { registerInstance(this, hostRef); this.onLoad = createEvent(this, "load", 7); this.onError = createEvent(this, "error", 7); this.src = undefined; } render() { const { src, onLoad, onError } = this; return (h("iframe", { class: 'taro-webview', onLoad: (e) => { e.stopPropagation(); onLoad.emit({ src }); }, onError: (e) => { e.stopPropagation(); onError.emit({ src }); }, src: src })); } }; WebView.style = indexCss; export { WebView as taro_web_view_core };