forked from MeCKodo/vue-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.vue
48 lines (46 loc) · 1.07 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<template>
<div id="wrapper">
<nav class="navbar navbar-default">
<div class="container">
<a class="navbar-brand" href="#">
<i class="glyphicon glyphicon-time"></i>
计划板
</a>
<ul class="nav navbar-nav">
<li><a v-link="'/home'">首页</a></li>
<li><a v-link="'/time-entries'">计划列表</a></li>
</ul>
</div>
</nav>
<div class="container">
<div class="col-sm-3">
<sidebar :time="totalTime"></sidebar>
</div>
<div class="col-sm-9">
<router-view></router-view>
</div>
</div>
</div>
</template>
<script>
import Sidebar from './components/Sidebar.vue'
export default {
components: { Sidebar },
data () {
return {
totalTime: 1.5
}
},
events: {
timeUpdate (timeEntry) {
console.log(timeEntry);
this.totalTime += parseFloat(timeEntry.totalTime)
},
deleteTime (timeEntry) {
this.totalTime -= parseFloat(timeEntry.totalTime)
}
}
}
</script>
<style>
</style>