Commit c654ea80 by 胡锦波

1. init 路由调通

parent f91a2ea5
......@@ -40,6 +40,13 @@
"env": {
"node": true
},
"globals": {
"_": "readonly"
},
"ignorePatterns": [
"node_modules",
"customer-service"
],
"extends": [
"plugin:vue/essential",
"@vue/standard",
......@@ -48,11 +55,25 @@
"parserOptions": {
"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": [
"> 1%",
"last 2 versions",
"not dead"
]
}
}
\ No newline at end of file
<template>
<div id="app">
<div id="nav">
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
<div id="app">
<router-view />
</div>
<router-view/>
</div>
</template>
<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>
export enum Direction {
Home = 1,
}
import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
import Home from '../views/Home.vue'
import Vue from 'vue';
import VueRouter, { RouteConfig } from 'vue-router';
import { Direction } from './direction';
import { MetaHeader } from './meta-header';
Vue.use(VueRouter)
Vue.use(VueRouter);
const routes: Array<RouteConfig> = [
{
path: '/',
name: 'Home',
component: Home
path: "",
redirect: "/workadmin/home"
},
{
path: '/about',
name: 'About',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
path: '/workadmin',
component: () => import('@/views/pages/main.vue'),
redirect: 'home',
children: [
{
path: 'home',
component: () => import('@/views/pages/home/home.vue'),
meta: { direction: Direction.Home, title: MetaHeader.home },
}
]
}
]
];
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
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 @@
</script>
<style lang="less" scoped>
@import "~@/css/variables.less";
</style>
<template>
<div>AddressBook</div>
<div>
234
<router-view></router-view>
</div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
@Component({ components: {} })
export default class AddressBook extends Vue {}
export default class Main extends Vue {}
</script>
<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