blog-client/layouts/default.vue

74 lines
1.9 KiB
Vue
Raw Normal View History

2019-02-07 16:26:17 +08:00
<template lang="pug">
.content
#loading.allSpinner
.spinner
.bounce1
.bounce2
.bounce3
.container
header
.header
.svg(@click='showLeftMenu')
svg(style='width: 25px; height:25px', viewBox='0 0 1024 1024', version='1.1', xmlns='http://www.w3.org/2000/svg', width='200', height='200')
path(d='M192 482l640 0 0 64-640 0 0-64Z')
path(d='M192 290l640 0 0 64-640 0 0-64Z')
path(d='M192 674l640 0 0 64-640 0 0-64Z')
nuxt-link(to='/')
h1.title
2020-05-10 19:39:05 +08:00
| 轶哥
2019-02-07 16:26:17 +08:00
.page-container
#LeftMenu(:style="'display: '+ showLeftMenuValue + ';' + isPhone")
LeftContent
#rightContent(@click='showLeftMenu(false)')
2019-02-07 16:26:17 +08:00
nuxt
Footer
2020-07-08 18:13:20 +08:00
v-dialog
2019-02-07 16:26:17 +08:00
</template>
<script>
import LeftContent from '~/components/LeftContent'
import Footer from '~/components/Footer'
export default {
components: {
LeftContent,
Footer
},
2019-12-13 11:46:15 +08:00
data () {
2019-02-07 16:26:17 +08:00
return {
showLeftMenuValue: 'block',
isPhone: ''
}
},
2019-12-13 11:46:15 +08:00
mounted () {
2019-02-07 16:26:17 +08:00
const phoneStyle = 'height: 100%; position: fixed; top: 70px; background-color: #fff; z-index:9999; overflow: scroll; overflow-x: hidden; -webkit-overflow-scrolling: touch;'
if (document.body.clientWidth > 768) {
this.showLeftMenuValue = 'block'
this.isPhone = ''
} else {
this.showLeftMenuValue = 'none'
this.isPhone = phoneStyle
}
window.onresize = () => {
if (document.body.clientWidth > 768) {
this.showLeftMenuValue = 'block'
this.isPhone = ''
} else {
this.showLeftMenuValue = 'none'
this.isPhone = phoneStyle
}
}
},
methods: {
showLeftMenu (show) {
if (this.showLeftMenuValue === 'block' || show === false) {
2019-02-07 16:26:17 +08:00
this.showLeftMenuValue = 'none'
} else {
this.showLeftMenuValue = 'block'
2019-02-07 16:26:17 +08:00
}
}
}
}
</script>