Last active
October 30, 2017 11:14
-
-
Save Phunky/1c77f39b372a5f970e05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style lang="sass" scoped> | |
.app { | |
position : relative; | |
width : 100vw; | |
height : 100vh; | |
margin : 0 !important; | |
} | |
.appbar { | |
position : absolute; | |
top : 0; | |
left : 0; | |
right : 0; | |
height : 64px; | |
padding : .5em 1.1em; | |
background : #db4437; | |
svg { | |
display : inline-block; | |
max-width : 24px; | |
max-height : 48px; | |
margin-left : 4px; | |
fill : rgba(255,255,255,1); | |
cursor : pointer; | |
} | |
} | |
.sidebar { | |
position : absolute; | |
top : 64px; | |
bottom : 0; | |
left : 0; | |
padding : 1em 0; | |
} | |
.view { | |
position : absolute; | |
top : 64px; | |
right : 0; | |
bottom : 0; | |
left : 64px; | |
background : #eee; | |
padding : 1em; | |
} | |
</style> | |
<template lang="jade"> | |
.app | |
.appbar | |
svg(@click='$refs.sidebar.show') | |
use(xlink:href="/static/sprites.svg#icon-menu") | |
.sidebar | |
v-sidebar( | |
:mini='sidemenu.mini', | |
:persistence='sidemenu.persistence', | |
v-ref:sidebar='') This would be my header | |
.view | |
</template> | |
<script> | |
import SuiButton from './components/sui-button.vue' | |
import VSidebar from './components/v-sidebar.vue' | |
export default { | |
data () { | |
return { | |
sidemenu: { | |
mini: [ | |
{ svg: 'icon-question_answer' }, | |
{ svg: 'icon-speaker_notes' }, | |
{ svg: 'icon-thumb_up' }, | |
{ svg: 'icon-thumb_down' }, | |
], | |
persistence: [ | |
{ | |
items: [ | |
{ text: 'Second' , svg: 'icon-question_answer' }, | |
{ text: 'Third' , svg: 'icon-speaker_notes' }, | |
{ text: 'Forth' , svg: 'icon-thumb_up' }, | |
{ text: 'Fith' , svg: 'icon-thumb_down' }, | |
] | |
}, | |
{ | |
header: 'Subheader', | |
items: [ | |
{ text: 'First' , image: 'http://semantic-ui.com/images/avatar/large/elliot.jpg' }, | |
{ text: 'Second' , image: 'http://semantic-ui.com/images/avatar/large/elliot.jpg' }, | |
{ text: 'Third' , image: 'http://semantic-ui.com/images/avatar/large/elliot.jpg' }, | |
] | |
}, | |
{ | |
items: [ | |
{ text: 'Fourth' , image: 'http://semantic-ui.com/images/avatar/large/elliot.jpg' }, | |
{ text: 'Fith' , image: 'http://semantic-ui.com/images/avatar/large/elliot.jpg' }, | |
{ text: 'Sixth' , image: 'http://semantic-ui.com/images/avatar/large/elliot.jpg' }, | |
] | |
} | |
] | |
} | |
} | |
}, | |
events: { | |
'v-sidebar:show' () { | |
console.log('v-sidebar:show') | |
}, | |
'v-sidebar:hide' () { | |
console.log('v-sidebar:hide') | |
} | |
}, | |
components : { | |
SuiButton, | |
VSidebar | |
} | |
} | |
</script> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment