-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.vue
42 lines (41 loc) · 1.09 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
<template>
<nav class="panel">
<p class="panel-heading">
repositories
</p>
<div class="panel-block">
<p class="control has-icons-left">
<input class="input is-small" type="text" placeholder="search" v-model="state.query">
<span class="icon is-small is-left">
<i class="fas fa-search" aria-hidden="true"></i>
</span>
</p>
</div>
<p class="panel-tabs">
<a
v-for="cat in state.categories" :key="cat"
:class="{'is-active': state.selectedCategory === cat}"
@click="() => state.selectedCategory = cat"
>{{cat}}</a>
</p>
<a class="panel-block" v-for="item in state.visibleItems" :key="item.label">
<span class="panel-icon">
<i class="fas fa-book" aria-hidden="true"></i>
</span>
{{item.label}}
</a>
</nav>
</template>
<script lang="ts">
import Vue from 'vue'
import { AppState } from './state';
import { autorun } from 'mobx';
export default Vue.extend({
props: ['state'],
mounted() {
autorun(() => {
console.log(this.state.query)
})
}
})
</script>