layout.vue 2.57 KB
<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 &copy; 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()
          },
          goNext() {
            this.$bus.emit('gonext')
          },
          goBack() {
            this.$bus.emit('goback')
          }

        }
    }
</script>