2018-03-26 16:04:04 +08:00
< template >
< div class = "mand" >
< template v-if ="isHome" >
< router -view > < / r o u t e r - v i e w >
< / template >
< template v-else >
< div class = "md-nav" >
< p class = "home" @click ="goToCategory" > < i > < / i > < i > < / i > < i > < / i > < / p >
< p class = "name" v-text ="navTitle" > < / p >
< p class = "name-zh" v-text ="navSubTitle" > < / p >
< / div >
< div class = "md-example-wrapper" >
< router -view > < / r o u t e r - v i e w >
< / div >
< / template >
< / div >
< / template >
< script >
import './assets/responsive'
export default {
name : 'app' ,
computed : {
navTitle ( ) {
return this . $route . name
} ,
navSubTitle ( ) {
return this . $route . meta . description
} ,
isHome ( ) {
const path = this . $route . path
return path === '/' || path === '/home' || path === '/category'
} ,
} ,
methods : {
goToCategory ( ) {
this . $router . push ( '/category' )
} ,
} ,
}
< / script >
< style lang = "stylus" >
block ( )
float left
width 100 %
. mand
position relative
min - height 100 %
max - width 750 px
2018-08-31 17:12:17 +08:00
font - size 28 px
2018-03-26 16:04:04 +08:00
font - size - adjust none
- webkit - text - size - adjust 100 %
- webkit - overflow - scrolling touch
font - family - apple - system , "Helvetica Neue" , Arial , "PingFang SC" , "Hiragino Sans GB" , STHeiti , "Microsoft YaHei" , "Microsoft JhengHei" , "Source Han Sans SC" , "Noto Sans CJK SC" , "Source Han Sans CN" , "Noto Sans SC" , "Source Han Sans TC" , "Noto Sans CJK TC" , "WenQuanYi Micro Hei" , SimSun , sans - serif ! important
- webkit - font - smoothing antialiased
- moz - osx - font - smoothing grayscale
background color - primary - background
. md - nav
position relative
display flex
padding 32 px 20 px
p
position relative
display inline - block
line - height 1
& . home
top 5 px
width 36 px
height 32 px
i
position absolute
left 0
width 100 %
height .04 rem
2018-09-28 18:10:57 +08:00
background color - mask
2018-03-26 16:04:04 +08:00
border - radius 2 px
& : nth - of - type ( 1 )
top 0
& : nth - of - type ( 2 )
top 50 %
width 70 %
margin - top - .02 rem
& : nth - of - type ( 3 )
bottom 0
& . name
margin - left h - gap - lg
font - size font - heading - large
font - weight font - weight - medium
color color - text - base
& . name - zh
top 9 px
margin - left h - gap - sm
2018-08-31 17:12:17 +08:00
font - size font - body - large
2018-03-26 16:04:04 +08:00
font - weight font - weight - normal
color color - text - minor
2018-08-31 17:12:17 +08:00
2018-03-26 16:04:04 +08:00
. md - example - wrapper
position relative
z - index 3
padding 20 px
clearfix ( )
. md - example
. md - example - section
clearfix ( )
margin - bottom 30 px
color color - text - base
. md - example - title
block ( )
font - size font - body - normal
font - weight font - weight - medium
a
margin - right 5 px
2018-09-28 18:10:57 +08:00
background color - primary
2018-03-26 16:04:04 +08:00
color # fff
padding 5 px 10 px
border - radius radius - normal
font - size font - minor - large
font - weight 300
line - height 28 px
text - decoration none
. md - example - describe
block ( )
margin - top 15 px
2018-08-31 17:12:17 +08:00
font - size font - minor - large
2018-03-26 16:04:04 +08:00
font - weight 300
color color - text - minor
. md - example - content
block ( )
position relative
margin - top 20 px
box - sizing border - box
2018-10-15 18:41:29 +08:00
font - size 28 px
2018-03-26 16:04:04 +08:00
. md - dialog pre
width 100 %
padding 20 px 10 px
box - sizing border - box
white - space pre - wrap
word - wrap break - word
font - size font - minor - normal
background color - primary - background
border - radius radius - normal
@ media screen and ( min - width : 749 px )
. mand
margin - left - 360 px
left 50 %
< / style >