|
1 | 1 | <script setup lang="ts">
|
2 | 2 | import { vQueryParam } from "../src";
|
3 |
| -import { computed, ref } from "vue"; |
| 3 | +import { ref } from "vue"; |
4 | 4 | import VueDatePicker from "@vuepic/vue-datepicker";
|
5 | 5 | import '@vuepic/vue-datepicker/dist/main.css'
|
6 |
| -import DatePicker from "./DatePicker.vue" |
7 | 6 |
|
8 |
| -
|
9 |
| -const filter = ref("") |
10 |
| -const date = ref("") |
11 |
| -const datestr = computed(() => `${date.value}`) |
12 |
| -const filterstr = computed(() => `${filter.value}`) |
13 |
| -const mirey = ref("") |
14 |
| -const search = ref("") |
15 |
| -const radiomodel = ref("Valor 1") |
| 7 | +const date = ref() |
| 8 | +const search = ref(0) |
16 | 9 | const selectmodel = ref("")
|
17 |
| -const checkmodel = ref(true) |
18 |
| -
|
19 |
| -function handlerFilter(id: string, value: string) { |
20 |
| - switch (id) { |
21 |
| - case "filter": |
22 |
| - filter.value = value |
23 |
| - break; |
24 |
| - case "mirey": |
25 |
| - mirey.value = value |
26 |
| - break; |
27 |
| - case "radio": |
28 |
| - radiomodel.value = value |
29 |
| - break |
30 |
| - case "checkin": |
31 |
| - checkmodel.value = value |
32 |
| - break |
33 |
| - } |
34 |
| -} |
35 | 10 |
|
36 | 11 | </script>
|
37 | 12 |
|
38 | 13 | <template>
|
39 |
| - <!-- <select v-model="selectmodel" v-query-param:selecto="selectmodel"> |
| 14 | + <input type="number" v-model="search" v-query-param:q="search" /> |
| 15 | + <select v-model="selectmodel" v-query-param:selecto="selectmodel"> |
40 | 16 | <option value="">Please select one</option>
|
41 | 17 | <option>A</option>
|
42 | 18 | <option>B</option>
|
43 | 19 | <option>C</option>
|
44 |
| - </select> --> |
45 |
| - <!-- <div v-query-param:radio="radiomodel"> |
46 |
| - <span>Radio inputs</span> |
47 |
| - <input type="radio" value="Valor 1" name="radioinput" v-model="radiomodel" /> |
48 |
| - <input type="radio" value="Valor 2" name="radioinput" v-model="radiomodel" /> |
49 |
| - <input type="radio" value="Valor 3" name="radioinput" v-model="radiomodel" /> |
50 |
| - {{ radiomodel }} |
51 |
| - </div> --> |
52 |
| - <!-- <div> |
53 |
| - <span>checkbox</span> |
54 |
| - <input type="checkbox" v-model="checkmodel" true-value="yes" false-value="no" v-query-param:checkin="checkmodel" /> |
55 |
| - </div> |
56 |
| - <div>Selected: {{ selectmodel }}</div> --> |
57 |
| - <!-- <div v-query-param:filter="filterstr">{{ typeof filter }}</div> |
58 |
| - <input type="number" v-model="filter" /> --> |
59 |
| - <!-- <div> |
60 |
| - <textarea v-model="search" v-query-param:textarea="search" placeholder="add multiple lines"></textarea> |
61 |
| - </div> --> |
| 20 | + </select> |
62 | 21 | <div>
|
63 |
| - <VueDatePicker v-query-param:datefrom="datestr" v-model="date"/> |
| 22 | + <VueDatePicker v-query-param:datefrom="{ |
| 23 | + model: date, |
| 24 | + format: (val: Date) => val.toLocaleDateString(), |
| 25 | + callback: (val: string) => date = new Date(val) |
| 26 | + }" v-model="date"/> |
64 | 27 | </div>
|
65 | 28 | </template>
|
66 | 29 |
|
|
0 commit comments