<tap-browser>
应用内浏览器,在推入 <tap-stack> 的 iframe 页面中打开 URL,
带有导航栏和用于自定义操作的动作面板。
Example
import { Browser } from '@mantou/tap-ui/elements/browser';
await Browser.open({
src: 'https://example.com',
title: 'Help',
items: [{ label: 'Share', handler: () => share() }],
});
API
Shadow DOM; Extends GemElement
Static Methods
| Method |
Type |
open |
<T = unknown>(options: BrowserOptions<T>) => DyPromise<void, { browser: TapBrowserElement<T>; }> & { browser: TapBrowserElement<T>; } |
Instance Properties
| Property(Attribute) |
Reactive |
Type |
Description |
src(src) |
Yes |
string |
|
title(title) |
Yes |
string |
|
headerless(headerless) |
Yes |
boolean |
Hide the navbar; close via the edge swipe-back gesture or close |
floatheader(floatheader) |
Yes |
boolean |
Navbar overlays the frame and stays transparent, since the frame's own scroll can't be observed. The page in the frame needs to handle the top inset itself. |
items |
Yes |
BrowserItem<T>[] |
|
actions |
Yes |
BrowserItem<T>[] |
|
groups |
Yes |
ActionSheetGroup<T>[] |
|
close |
|
Emitter<null> |
|
select |
|
Emitter<BrowserItem<T>> |
|
get contentWindow |
|
Window | null |
|
Instance Methods
| Method |
Type |
Description |
reload |
() => void |
Reload src |
Other
| Type |
Value |
| Event |
close, select |
| Part |
navbar, frame, more, action |