forked from cerebral/overmind
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.vue
More file actions
65 lines (64 loc) · 1.24 KB
/
App.vue
File metadata and controls
65 lines (64 loc) · 1.24 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<style scoped>
.wrapper {
display: flex;
height: 100%;
justify-content: center;
padding: 20px;
font-family: 'Helvetica Neue';
}
.container {
min-width: 500px;
}
.tabs {
display: flex;
align-items: center;
justify-content: space-around;
}
.tab {
font-size: 16px;
cursor: pointer;
}
.tab:hover {
color: blue;
}
.tab.selected {
font-weight: bold;
color: blue;
cursor: default;
}
</style>
<template>
<div class="wrapper">
<div class="container">
<div class="tabs">
<div
class="tab"
v-bind:class="{selected: app.state.tabs.current === 'posts'}"
v-on:click="app.actions.tabs.changeTo('posts')"
>
Posts
</div>
<div
class="tab" v-bind:class="{selected: app.state.tabs.current === 'users'}"
v-on:click="app.actions.tabs.changeTo('users')"
>
Users
</div>
</div>
<Posts v-if="app.state.tabs.current === 'posts'" />
<Users v-if="app.state.tabs.current === 'users'" />
</div>
</div>
</template>
<script>
import { connect } from '../app'
import Posts from './Posts.vue'
import Users from './Users.vue'
export default connect({
name: 'App',
components: {
Posts,
Users,
},
})
</script>