0.0.9 • Published 2 years ago

vue-router-push v0.0.9

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

vue-router-push

One line command, write router file and create new page file.

Install

npm i -g vue-router-push

Usage

vrp /user/info/list

Make sure you have a file vrp.config.json in your root directory.

{
    "routerPath": "/src/router/index.ts",
    "pageDir": "/src/views",
    "componentPrefix": "../views"
}

The routing configuration is saved using a variable called routes .

import { createRouter, createWebHistory } from 'vue-router';
import HomeView from '../views/HomeView.vue';

const routes = [{
  path: '/',
  name: 'home',
  component: HomeView
}, {
  path: '/about',
  name: 'about',
  component: () => import('../views/AboutView.vue'),
}];

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
});
export default router;

You can choose to create a file vrp.template.vue in the root directory to use as a template for new files, or use the default.

<script lang="ts" setup>
    import { reactive, ref } from 'vue';
    const state = reactive({});
</script>
<template>
    <div class="">
        <router-view></router-view>
    </div>
</template>
<style>
    
</style>
0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1-beta

2 years ago

0.0.1

2 years ago