1.1.2 • Published 2 years ago

dis-vue-router v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

dis-vue-router

A Vue router power by vue-router with Hooks

Install

npm install dis-vue-router

Usage

add: @/Layout/Index.ts:

import Layout from "@/Layout/Index.vue";
import { useDisRoute } from "dis-vue-router";
export default useDisRoute(Layout, {
  path: "/",
  redirect: "hello",
});

add: @/views/HelloView.ts:

import { useDisRoute } from "dis-vue-router";
import Layout from "@/Layout/Index.ts";
export default useDisRoute(()=>import("@/views/HelloView.vue")),{
  path: "hello",
  layout: Layout,
});

src\router\index.ts:

import { createRouter, createWebHistory } from "vue-router";
import { getDisRoutes } from "dis-vue-router";
import "@/views/HelloView.ts"; // enable route component

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: getDisRoutes(), // getDisRoutes() will return all routes
});

export default router;
1.1.1

2 years ago

1.1.2

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago