Vue
HTML
<div id="app">
<div class="navbar">
Navbar
</div>
<div class="sidebar">
Sidebar with padding-top
<ul>
<li draggable v-for="n in items">item {{ n }}</li>
</ul>
</div>
<div class="content">
<h2>Todos:</h2>
<ol>
<li v-for="todo in todos">
<label>
<input type="checkbox" v-on:change="toggle(todo)" v-bind:checked="todo.done">
<del v-if="todo.done">
{{ todo.text }}
</del>
<span v-else>
{{ todo.text }}
</span>
</label>
</li>
</ol>
</div>
</div>
SCSS
$navbarh: 30px;
body {
background: #20262E;
font-family: Helvetica;
overflow: hidden;
}
#app {
background: #fff;
}
.navbar {
position: fixed;
height: $navbarh;
background-color: lightgreen;
width: 100%;
z-index: 2;
}
.sidebar {
position: fixed;
width: 80px;
background-color: lightgray;
height: 100%;
padding-top: $navbarh;
z-index: 1;
overflow-y: auto;
}
.content {
background-color: #fff;
position: absolute;
padding: 35px 0 0 90px;
height: 100%;
width: 100%;
z-index: 0;
}
li {
margin: 8px 0;
}
h2 {
font-weight: bold;
margin-bottom: 15px;
}
del {
color: rgba(0, 0, 0, 0.3);
}
Vue
new Vue({
el: "#app",
data: {
todos: [
{ text: "Learn JavaScript", done: false },
{ text: "Learn Vue", done: false },
{ text: "Play around in JSFiddle", done: true },
{ text: "Build something awesome", done: true }
],
items: 12
},
methods: {
toggle: function(todo){
todo.done = !todo.done
}
}
})