forked from oarepo/vue-query-synchronizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHome.vue
73 lines (71 loc) · 1.93 KB
/
Home.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<template>
<div class="home">
<br>
Write anything here and watch the addressbar. Later <a href="/">reload the application</a>
to see that the default value in the first field was taken from the local storage.<br><br>
<table>
<tr>
<td>
Field with default debouncing of 100ms, stored to the local storage:
</td>
<td>
<input v-model="query.search"><br><br>
</td>
</tr>
<tr>
<td>
Field with custom debouncing of 1000ms:
</td>
<td>
<input v-model="query.search2"><br><br>
</td>
</tr>
<tr>
<td>
Number field with the default value of 10:
</td>
<td>
<input type="number" v-model="query.num"><br><br>
</td>
</tr>
<tr>
<td>
Checkbox:
</td>
<td>
<input type="checkbox" v-model="query.check"><br><br>
</td>
</tr>
<tr>
<td>
Array (multiple selection, control-click for selecting both values):
</td>
<td>
<select multiple v-model="query.option">
<option value="first">First choice</option>
<option value="second">Second choice</option>
</select><br><br>
</td>
</tr>
</table>
<br><br>
Another property from router, not affected by the addressbar: <code>{{ another }}</code><br><br>
query equals:
<pre>{{stringifiedQuery}}</pre>
</div>
</template>
<script>
export default {
name: 'home',
components: {},
props: {
query: Object,
another: String
},
computed: {
stringifiedQuery () {
return JSON.stringify(this.query, undefined, 4)
}
}
}
</script>