0.1.3 ā€¢ Published 1 year ago

@b12k/vue3-router-gmc v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Vue 3 Router - Get Matched Components

Instalation

npm

npm i @b12k/vue3-router-gmc

yarn

yarn add @b12k/vue3-router-gmc

pnpm

pnpm add @b12k/vue3-router-gmc

Usage

import { getMatchedComponents } from '@b12k/vue3-router-gmc';
import { createRouter } from 'vue-router';

const router = createRouter({
  /* routes */
});

router.beforeEach(async (to, from) => {
  const {
    entering, // array of components entering the page
    leaving, // array of components leaving the page
    staying, // array of components staying on the page
  } = await getMatchedComponents(to, from);
});

šŸ’” Also works with beforeResolve guard.

Real world example

This lib is used in The Boilerplate Vue šŸ‘‰ HERE

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago