UNPKG

@tarojs/components

Version:
28 lines (23 loc) 772 B
'use strict'; const index = require('./index-ae99cbcc.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) { index.registerInstance(this, hostRef); this.onLoad = index.createEvent(this, "load", 7); this.onError = index.createEvent(this, "error", 7); this.src = undefined; } render() { const { src, onLoad, onError } = this; return (index.h("iframe", { class: 'taro-webview', onLoad: (e) => { e.stopPropagation(); onLoad.emit({ src }); }, onError: (e) => { e.stopPropagation(); onError.emit({ src }); }, src: src })); } }; WebView.style = indexCss; exports.WebView = WebView;