You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.5 KiB
71 lines
1.5 KiB
|
6 years ago
|
<script type="text/jsx">
|
||
|
6 years ago
|
import {title} from '@/config'
|
||
|
6 years ago
|
|
||
|
6 years ago
|
export default {
|
||
|
6 years ago
|
name: 'Logo',
|
||
|
6 years ago
|
|
||
|
6 years ago
|
functional: true,
|
||
|
6 years ago
|
|
||
|
6 years ago
|
props: {showTitle: Boolean},
|
||
|
6 years ago
|
|
||
|
6 years ago
|
render(h, context) {
|
||
|
6 years ago
|
const {showTitle} = context.props
|
||
|
6 years ago
|
|
||
|
6 years ago
|
const logoClass = {'logo-container': true, 'no-title': !showTitle}
|
||
|
6 years ago
|
|
||
|
6 years ago
|
return (
|
||
|
|
<div class={logoClass}>
|
||
|
6 years ago
|
<router-link class="logo-link" to="/">
|
||
|
|
<img src={`${process.env.BASE_URL}static/img/logo.svg`}/>
|
||
|
|
{showTitle && <h1 class="logo-title">{title}</h1>}
|
||
|
6 years ago
|
</router-link>
|
||
|
|
</div>
|
||
|
|
)
|
||
|
6 years ago
|
}
|
||
|
6 years ago
|
}
|
||
|
6 years ago
|
</script>
|
||
|
6 years ago
|
|
||
|
|
<style lang="scss">
|
||
|
|
@import "~@/asset/style/variables.scss";
|
||
|
|
|
||
|
|
$logoSize: 30px;
|
||
|
|
|
||
|
6 years ago
|
.logo-container {
|
||
|
6 years ago
|
position: relative;
|
||
|
|
width: 100%;
|
||
|
|
height: $nav-height;
|
||
|
|
line-height: $nav-height;
|
||
|
|
padding-left: 20px;
|
||
|
|
|
||
|
6 years ago
|
.logo-link {
|
||
|
|
display: block;
|
||
|
6 years ago
|
height: 100%;
|
||
|
|
|
||
|
6 years ago
|
> img {
|
||
|
|
display: inline-block;
|
||
|
6 years ago
|
height: $logoSize;
|
||
|
|
vertical-align: middle;
|
||
|
|
|
||
|
6 years ago
|
& + .logo-title {
|
||
|
6 years ago
|
margin-left: 12px;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
6 years ago
|
.logo-title {
|
||
|
6 years ago
|
display: inline-block;
|
||
|
|
margin: 0;
|
||
|
|
color: #ffffff;
|
||
|
|
font-weight: 600;
|
||
|
|
line-height: $nav-height;
|
||
|
|
font-size: 14px;
|
||
|
|
font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
|
||
|
|
vertical-align: middle;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
6 years ago
|
&.no-title {
|
||
|
|
padding-left: ($aside-icon-size + 20px * 2 - $logoSize) / 2;
|
||
|
6 years ago
|
}
|
||
|
|
}
|
||
|
|
</style>
|