mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(): update to Stencil One 🎉🎊
This commit is contained in:
@ -82,13 +82,6 @@ Type: `Promise<void>`
|
||||
|
||||
Navigate to the specified URL.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ----------- | ------------------------------- | -------------------------------------------------------- |
|
||||
| `url` | `string` | The url to navigate to. |
|
||||
| `direction` | `"back" \| "forward" \| "root"` | The direction of the animation. Defaults to `"forward"`. |
|
||||
|
||||
#### Returns
|
||||
|
||||
Type: `Promise<boolean>`
|
||||
|
||||
@ -73,7 +73,7 @@ export class Router implements ComponentInterface {
|
||||
this.win.addEventListener('ionRouteDataChanged', debounce(this.onRoutesChanged.bind(this), 100));
|
||||
}
|
||||
|
||||
@Listen('window:popstate')
|
||||
@Listen('popstate', { target: 'window' })
|
||||
protected onPopState() {
|
||||
const direction = this.historyDirection();
|
||||
const path = this.getPath();
|
||||
@ -81,7 +81,7 @@ export class Router implements ComponentInterface {
|
||||
return this.writeNavStateRoot(path, direction);
|
||||
}
|
||||
|
||||
@Listen('document:ionBackButton')
|
||||
@Listen('ionBackButton', { target: 'document' })
|
||||
protected onBackButton(ev: BackButtonEvent) {
|
||||
ev.detail.register(0, () => this.back());
|
||||
}
|
||||
@ -115,7 +115,7 @@ export class Router implements ComponentInterface {
|
||||
|
||||
/** @internal */
|
||||
@Method()
|
||||
printDebug() {
|
||||
async printDebug() {
|
||||
console.debug('CURRENT PATH', this.getPath());
|
||||
console.debug('PREVIOUS PATH', this.previousPath);
|
||||
printRoutes(readRoutes(this.el));
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet">
|
||||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet">
|
||||
<script src="../../../../../scripts/testing/scripts.js"></script>
|
||||
<script src="../../../../../dist/ionic.js"></script>
|
||||
<script>
|
||||
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
|
||||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script> <script>
|
||||
|
||||
class PageOne extends HTMLElement {
|
||||
connectedCallback() {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { mockWindow } from '@stencil/core/mock-doc';
|
||||
import { mockWindow } from '@stencil/core/testing';
|
||||
|
||||
import { RouteChain, RouteID } from '../utils/interface';
|
||||
import { routerIDsToChain, routerPathToChain } from '../utils/matching';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { mockWindow } from '@stencil/core/mock-doc';
|
||||
import { mockWindow } from '@stencil/core/testing';
|
||||
|
||||
import { RouteRedirect, RouteTree } from '../utils/interface';
|
||||
import { flattenRouterTree, readRedirects, readRouteNodes } from '../utils/parser';
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet">
|
||||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet">
|
||||
<script src="../../../../../scripts/testing/scripts.js"></script>
|
||||
<script src="../../../../../dist/ionic.js"></script>
|
||||
<script>
|
||||
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
|
||||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script> <script>
|
||||
|
||||
class PageOne extends HTMLElement {
|
||||
connectedCallback() {
|
||||
|
||||
@ -1,5 +1,10 @@
|
||||
import { ComponentProps } from '../../../interface';
|
||||
|
||||
export interface HTMLStencilElement extends HTMLElement {
|
||||
componentOnReady(): Promise<this>;
|
||||
forceUpdate(): void;
|
||||
}
|
||||
|
||||
export interface NavOutlet {
|
||||
setRouteId(id: string, params: ComponentProps | undefined, direction: RouterDirection): Promise<RouteWrite>;
|
||||
getRouteId(): Promise<RouteID | undefined>;
|
||||
|
||||
Reference in New Issue
Block a user