提交 | 用户 | age
|
957068
|
1 |
<template> |
426632
|
2 |
<div style="width:1250px;"> |
957068
|
3 |
<RouterView /> |
J |
4 |
<div class="routes" v-if="isDev"> |
|
5 |
<RouterLink v-for="item in routes" :key="item.name" :to="item.path">{{ |
|
6 |
item.name |
|
7 |
}}</RouterLink> |
|
8 |
</div> |
|
9 |
</div> |
|
10 |
</template> |
|
11 |
<script setup> |
|
12 |
import routes from "@/router/routes.js"; |
|
13 |
import {getParams} from "./utils/index"; |
|
14 |
import router from './router/index' |
|
15 |
|
3acd49
|
16 |
const isDev = isDevelopment; |
957068
|
17 |
if (isDev) { |
J |
18 |
console.log("开发环境"); |
|
19 |
} else { |
|
20 |
console.log("生产环境"); |
|
21 |
} |
|
22 |
let urlParams = getParams(location.href); |
|
23 |
let routePath = urlParams('ProcessName') |
|
24 |
if (!!routePath) { |
acab47
|
25 |
router.push({ |
J |
26 |
name: routePath |
|
27 |
}); |
957068
|
28 |
} |
J |
29 |
</script> |
|
30 |
|
|
31 |
<style lang="less" scoped> |
|
32 |
.routes { |
|
33 |
position: fixed; |
|
34 |
top: 0; |
|
35 |
left: 0; |
|
36 |
a{ |
|
37 |
color: #008c8c; |
|
38 |
border: 1px solid #008c8c; |
|
39 |
margin: 5px; |
|
40 |
&:hover{ |
|
41 |
background-color: #e0e0e0; |
|
42 |
} |
|
43 |
} |
|
44 |
} |
|
45 |
</style> |