layout.vue
2.34 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<style scoped>
.layout {
background: #f5f7f9;
position: relative;
overflow: hidden;
}
.layout-logo {
width: 100px;
height: 30px;
background: #5b6270;
border-radius: 3px;
float: left;
position: relative;
top: 15px;
left: 20px;
}
.layout-nav {
width: 420px;
margin: 0 auto;
margin-right: 20px;
}
.layout-footer-center {
text-align: center;
}
.title {
text-align: center;
color: white;
font-size: 28px;
}
</style>
<template>
<div class="layout">
<Layout>
<Header>
<Menu mode="horizontal" theme="dark" active-name="1">
<div class="title">YOHO!人工智能平台</div>
</Menu>
</Header>
<Layout>
<Sider hide-trigger :style="{background: '#fff'}">
<Menu active-name="1-1" theme="light" width="auto" :open-names="['1']" @on-select="open">
<Submenu name="1">
<template slot="title">
<Icon type="ios-navigate"></Icon>
数据生产
</template>
<MenuItem name="similar.list">相似图</MenuItem>
<MenuItem name="image.list">商品识别</MenuItem>
<MenuItem name="similar.fast">fast</MenuItem>
</Submenu>
</Menu>
</Sider>
<Layout :style="{padding: '0 24px 24px'}">
<Breadcrumb :style="{margin: '24px 0'}">
<BreadcrumbItem>首页</BreadcrumbItem>
<BreadcrumbItem>相似图</BreadcrumbItem>
</Breadcrumb>
<Content :style="{padding: '24px', minHeight: '280px', background: '#fff'}">
<router-view @backtop="goTop"></router-view>
</Content>
</Layout>
</Layout>
<Footer class="layout-footer-center">2011-2018 © YOHO</Footer>
</Layout>
<BackTop ref="backtop"></BackTop>
</div>
</template>
<script>
export default {
created() {
this.$router.push({ name: "similar.list" });
},
methods: {
open(name) {
this.$router.push({ name });
},
goTop() {
this.$refs.backtop.back();
}
}
};
</script>