admin_add_router

This commit is contained in:
xiaomlove
2021-04-07 19:42:39 +08:00
parent e48461546f
commit be9b8634c4
7 changed files with 48 additions and 3 deletions

View File

@@ -11512,6 +11512,11 @@
}
}
},
"vue-router": {
"version": "4.0.6",
"resolved": "https://registry.npm.taobao.org/vue-router/download/vue-router-4.0.6.tgz?cache=0&sync_timestamp=1617697788171&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-router%2Fdownload%2Fvue-router-4.0.6.tgz",
"integrity": "sha1-kXUNtQfSZkLyJbDsYGRWjl/kSNY="
},
"vue-style-loader": {
"version": "4.1.3",
"resolved": "https://registry.npm.taobao.org/vue-style-loader/download/vue-style-loader-4.1.3.tgz?cache=0&sync_timestamp=1614758652197&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-style-loader%2Fdownload%2Fvue-style-loader-4.1.3.tgz",
@@ -11536,6 +11541,11 @@
"integrity": "sha1-HuO8mhbsv1EYvjNLsV+cRvgvWCU=",
"dev": true
},
"vuex": {
"version": "3.6.2",
"resolved": "https://registry.npm.taobao.org/vuex/download/vuex-3.6.2.tgz",
"integrity": "sha1-I2vAhqhww655lG8QfxbeWdWJXnE="
},
"watchpack": {
"version": "1.7.5",
"resolved": "https://registry.npm.taobao.org/watchpack/download/watchpack-1.7.5.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwatchpack%2Fdownload%2Fwatchpack-1.7.5.tgz",

View File

@@ -10,7 +10,9 @@
"dependencies": {
"core-js": "^3.6.5",
"element-plus": "^1.0.2-beta.28",
"vue": "^3.0.0"
"vue": "^3.0.0",
"vue-router": "^4.0.6",
"vuex": "^3.6.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",

View File

@@ -114,12 +114,15 @@ export default {
methods: {
handleSelect(key, keyPath) {
console.log(key, keyPath);
console.log("select", this)
},
handleOpen(key, keyPath) {
console.log(key, keyPath);
console.log("open", this)
},
handleClose(key, keyPath) {
console.log(key, keyPath);
console.log("close", this)
}
}
}

5
admin/src/main.js vendored
View File

@@ -1,7 +1,8 @@
import { createApp } from 'vue'
import App from './App.vue'
import installElementPlus from './plugins/element'
import router from './router'
const app = createApp(App)
const app = createApp(App).use(router)
installElementPlus(app)
app.mount('#app')
app.mount('#app')

View File

@@ -0,0 +1,3 @@
<template>
<h1>Agent Allow Page</h1>
</template>

View File

@@ -0,0 +1,3 @@
<template>
<h1>Home Page</h1>
</template>

23
admin/src/router/index.js vendored Normal file
View File

@@ -0,0 +1,23 @@
import { createWebHistory, createRouter } from "vue-router";
import Home from "../pages/index";
import AgentAllow from "../pages/agent-allow";
const routes = [
{
path: "/",
name: "Home",
component: Home,
},
{
path: "/agent-allow",
name: "Agent-allow",
component: AgentAllow,
},
];
const router = createRouter({
history: createWebHistory(),
routes,
});
export default router;