mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
feat(react, vue, angular): use tabs without router (#29794)
Issue number: resolves #25184 --------- Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com> Co-authored-by: Sean Perkins <13732623+sean-perkins@users.noreply.github.com>
This commit is contained in:
@ -43,7 +43,17 @@ export class Tabs implements NavOutlet {
|
||||
|
||||
async componentWillLoad() {
|
||||
if (!this.useRouter) {
|
||||
this.useRouter = !!document.querySelector('ion-router') && !this.el.closest('[no-router]');
|
||||
/**
|
||||
* JavaScript and StencilJS use `ion-router`, while
|
||||
* the other frameworks use `ion-router-outlet`.
|
||||
*
|
||||
* If either component is present then tabs will not use
|
||||
* a basic tab-based navigation. It will use the history
|
||||
* stack or URL updates associated with the router.
|
||||
*/
|
||||
this.useRouter =
|
||||
(!!this.el.querySelector('ion-router-outlet') || !!document.querySelector('ion-router')) &&
|
||||
!this.el.closest('[no-router]');
|
||||
}
|
||||
if (!this.useRouter) {
|
||||
const tabs = this.tabs;
|
||||
|
||||
Reference in New Issue
Block a user