UNPKG

@tarojs/components

Version:
82 lines (81 loc) 1.77 kB
import { h } from '@stencil/core'; export class WebView { constructor() { 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 })); } static get is() { return "taro-web-view-core"; } static get originalStyleUrls() { return { "$": ["./style/index.scss"] }; } static get styleUrls() { return { "$": ["./style/index.css"] }; } static get properties() { return { "src": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "src", "reflect": false } }; } static get events() { return [{ "method": "onLoad", "name": "load", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [], "text": "" }, "complexType": { "original": "any", "resolved": "any", "references": {} } }, { "method": "onError", "name": "error", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [], "text": "" }, "complexType": { "original": "any", "resolved": "any", "references": {} } }]; } }