forked from dcloudio/uni-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathleft-window.vue
44 lines (44 loc) · 880 Bytes
/
left-window.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<template>
<view class="left-window-style">
<indexPage />
</view>
</template>
<script>
import indexPage from '@/pages/index/index'
export default {
components: { indexPage },
props: {
matchLeftWindow: {
type: Boolean
}
},
watch: {
$route: {
immediate: true,
handler(newRoute) {
if (this.matchLeftWindow) {
if (newRoute.path === '/') {
uni.redirectTo({
url: 'pages/vue/color/color'
})
}
if (!newRoute.matched.length) {
uni.redirectTo({
url: 'pages/error/404'
})
}
}
}
}
}
}
</script>
<style>
.left-window-style {
min-height: calc(100vh - var(--top-window-height));
overflow-y: hidden;
background-color: #fff;
border-right: 1px solid #f5f5f5;
box-shadow: rgb(0 0 0 / 8%) 0px 0px 3px 1px;
}
</style>