Commit c654ea80 by 胡锦波

1. init 路由调通

parent f91a2ea5
...@@ -40,6 +40,13 @@ ...@@ -40,6 +40,13 @@
"env": { "env": {
"node": true "node": true
}, },
"globals": {
"_": "readonly"
},
"ignorePatterns": [
"node_modules",
"customer-service"
],
"extends": [ "extends": [
"plugin:vue/essential", "plugin:vue/essential",
"@vue/standard", "@vue/standard",
...@@ -48,7 +55,21 @@ ...@@ -48,7 +55,21 @@
"parserOptions": { "parserOptions": {
"ecmaVersion": 2020 "ecmaVersion": 2020
}, },
"rules": {} "rules": {
"indent": "off",
"semi": [
"error",
"always"
],
"quotes": "off",
"comma-dangle": "off",
"space-before-function-paren": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/camelcase": "off",
"no-useless-constructor": "off",
"no-console": "error",
"@typescript-eslint/no-namespace": "off"
}
}, },
"browserslist": [ "browserslist": [
"> 1%", "> 1%",
......
<template> <template>
<div id="app"> <div id="app">
<div id="nav"> <router-view />
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
</div>
<router-view/>
</div> </div>
</template> </template>
<style lang="less"> <style lang="less">
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
#nav {
padding: 30px;
a {
font-weight: bold;
color: #2c3e50;
&.router-link-exact-active {
color: #42b983;
}
}
}
</style> </style>
export enum Direction {
Home = 1,
}
import Vue from 'vue' import Vue from 'vue';
import VueRouter, { RouteConfig } from 'vue-router' import VueRouter, { RouteConfig } from 'vue-router';
import Home from '../views/Home.vue' import { Direction } from './direction';
import { MetaHeader } from './meta-header';
Vue.use(VueRouter) Vue.use(VueRouter);
const routes: Array<RouteConfig> = [ const routes: Array<RouteConfig> = [
{ {
path: '/', path: "",
name: 'Home', redirect: "/workadmin/home"
component: Home
}, },
{ {
path: '/about', path: '/workadmin',
name: 'About', component: () => import('@/views/pages/main.vue'),
// route level code-splitting redirect: 'home',
// this generates a separate chunk (about.[hash].js) for this route children: [
// which is lazy-loaded when the route is visited. {
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue') path: 'home',
component: () => import('@/views/pages/home/home.vue'),
meta: { direction: Direction.Home, title: MetaHeader.home },
}
]
} }
] ];
const router = new VueRouter({ const router = new VueRouter({
mode: 'history', mode: 'history',
base: process.env.BASE_URL, base: process.env.BASE_URL,
routes routes
}) });
export default router export default router;
export class MetaHeader {
public static readonly home = '首页';
}
<template>
<div>ApplicationRecord</div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
@Component({ components: {} })
export default class ApplicationRecord extends Vue {}
</script>
<style lang="less" scoped>
@import "~@/css/variables.less";
</style>
<template>
<div>ApplicationSetting</div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
@Component({ components: {} })
export default class ApplicationSetting extends Vue {}
</script>
<style lang="less" scoped>
@import "~@/css/variables.less";
</style>
<template>
<div>EnterpriseInfo</div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
@Component({ components: {} })
export default class EnterpriseInfo extends Vue {}
</script>
<style lang="less" scoped>
@import "~@/css/variables.less";
</style>
<template>
<div>ManagerLog</div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
@Component({ components: {} })
export default class ManagerLog extends Vue {}
</script>
<style lang="less" scoped>
@import "~@/css/variables.less";
</style>
<template>
<div>ManagerSetting</div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
@Component({ components: {} })
export default class ManagerSetting extends Vue {}
</script>
<style lang="less" scoped>
@import "~@/css/variables.less";
</style>
...@@ -10,4 +10,5 @@ ...@@ -10,4 +10,5 @@
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import "~@/css/variables.less";
</style> </style>
<template> <template>
<div>AddressBook</div> <div>
234
<router-view></router-view>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Vue } from "vue-property-decorator"; import { Component, Vue } from "vue-property-decorator";
@Component({ components: {} }) @Component({ components: {} })
export default class AddressBook extends Vue {} export default class Main extends Vue {}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
<template>
<div>InvoiceRecord</div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
@Component({ components: {} })
export default class InvoiceRecord extends Vue {}
</script>
<style lang="less" scoped>
@import "~@/css/variables.less";
</style>
<template>
<div>InvoiceTtitles</div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
@Component({ components: {} })
export default class InvoiceTtitles extends Vue {}
</script>
<style lang="less" scoped>
@import "~@/css/variables.less";
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment