-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.vue
59 lines (55 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
49
50
51
52
53
54
55
56
57
58
59
<template>
<div id="app">
<TextInput
v-model="regex"
placeholder="Regular Expression"
/>
<Stats
:load-time="$store.state.loadTime"
:matches="$store.state.filtered.length"
:total="$store.state.words.length"
/>
<WordList :words="$store.state.filtered" />
</div>
</template>
<script>
import Stats from './components/Stats.vue';
import TextInput from './components/TextInput.vue';
import WordList from './components/WordList.vue';
export default {
components: {
Stats,
TextInput,
WordList,
},
computed: {
regex: {
get() {
return this.$store.state.regex;
},
set(value) {
this.$store.dispatch('filterWords', value);
},
},
},
created() {
this.$store.dispatch('fetchWords');
},
};
</script>
<style lang="less">
@import "./assets/variables.less";
body {
color: @primary-text-color;
margin: 0;
padding: 0;
#app {
max-width: 900px;
margin: 0 auto;
height: 100vh;
font-family: sans-serif;
display: flex;
flex-direction: column;
}
}
</style>