11<template >
2- <div class =" row q-col-gutter-lg" >
3- <div class =" col-sm-8 col-sx-12" >
4- <q-list class =" q-gutter-y-sm" >
5- <div class =" column" >
6- <div class =" text-h6" >Component</div >
7- <q-field
8- dense
9- outlined
10- >
11- <template v-slot :control >
12- <number
13- class =" q-field__input"
14- v-model =" price"
15- v-bind =" config"
16- />
17- </template >
18- </q-field >
19- <div >Model value: <span class =" text-bold" >{{price}}</span ></div >
20- </div >
21- <div class =" column" >
22- <div class =" text-h6" >Directive</div >
23- <q-field
24- dense
25- outlined
26- hint =" masking doesn't work with directive"
27- >
28- <template v-slot :control >
29- <input
30- type =" tel"
31- class =" q-field__input"
32- v-number =" config"
33- v-model =" priceDirective"
34- />
35- </template >
36- </q-field >
37- <div >Model value: <span class =" text-bold" >{{priceDirective}}</span ></div >
38- </div >
39- <div class =" column" >
40- <div class =" text-h6" >Directive on Custom Component of <a href =" https://quasar.dev/vue-components/input" target =" _blank" >QInput</a ></div >
41- <q-input
42- dense
43- outlined
44- v-model =" priceUnmasked"
45- v-number =" config"
46- />
47- <div >Model value: <span class =" text-bold" >{{priceUnmasked}}</span ></div >
48- </div >
49- </q-list >
2+ <div class =" row q-col-gutter-lg" >
3+ <div class =" col-sm-8 col-sx-12" >
4+ <q-list :dark =" false" class =" q-gutter-y-sm" >
5+ <div class =" column" >
6+ <div class =" text-h6" >Component</div >
7+ <q-field
8+ :dark =" false"
9+ dense
10+ outlined
11+ >
12+ <template v-slot :control >
13+ <number
14+ class =" q-field__input"
15+ v-model =" price"
16+ v-bind =" config"
17+ />
18+ </template >
19+ </q-field >
20+ <div >Model value: <span class =" text-bold" >{{price}}</span ></div >
5021 </div >
51- <div class =" col-sm-4 col-sx-12" >
52- <q-list class =" q-gutter-y-sm" >
53- <q-input dense v-model =" config.prefix" type =" text" label =" Prefix" />
54- <q-input dense v-model =" config.suffix" type =" text" label =" Suffix" />
55- <q-input dense v-model.number =" config.precision" type =" number" min =" 0" max =" 5" label =" Precision" />
56- <q-input dense v-model =" config.decimal" type =" text" label =" Decimal" />
57- <q-input dense v-model =" config.separator" type =" text" label =" Separator" />
58- <q-checkbox dense v-model =" config.masked" label =" Masked" />
59- </q-list >
22+ <div class =" column" >
23+ <div class =" text-h6" >Directive</div >
24+ <q-field
25+ :dark =" false"
26+ dense
27+ outlined
28+ hint =" masking doesn't work with directive"
29+ >
30+ <template v-slot :control >
31+ <input
32+ type =" tel"
33+ class =" q-field__input"
34+ v-number =" config"
35+ v-model =" priceDirective"
36+ />
37+ </template >
38+ </q-field >
39+ <div >Model value: <span class =" text-bold" >{{priceDirective}}</span ></div >
6040 </div >
41+ <div class =" column" >
42+ <div class =" text-h6" >Directive on Custom Component of <a href =" https://quasar.dev/vue-components/input" target =" _blank" >QInput</a ></div >
43+ <q-input
44+ :dark =" false"
45+ dense
46+ outlined
47+ v-model =" priceUnmasked"
48+ v-number =" config"
49+ />
50+ <div >Model value: <span class =" text-bold" >{{priceUnmasked}}</span ></div >
51+ </div >
52+ </q-list >
53+ </div >
54+ <div class =" col-sm-4 col-sx-12" >
55+ <q-list :dark =" false" class =" q-gutter-y-sm" >
56+ <q-input :dark =" false" dense v-model =" config.prefix" type =" text" label =" Prefix" />
57+ <q-input :dark =" false" dense v-model =" config.suffix" type =" text" label =" Suffix" />
58+ <q-input :dark =" false" dense v-model.number =" config.precision" type =" number" min =" 0" max =" 5" label =" Precision" />
59+ <q-input :dark =" false" dense v-model =" config.decimal" type =" text" label =" Decimal" />
60+ <q-input :dark =" false" dense v-model =" config.separator" type =" text" label =" Separator" />
61+ <q-checkbox :dark =" false" dense v-model =" config.masked" label =" Masked" />
62+ </q-list >
6163 </div >
64+ </div >
6265</template >
6366
6467<script >
6568export default {
66- data () {
67- return {
68- price: 0 ,
69- priceDirective: 5432.1 ,
70- priceUnmasked: 6789.10 ,
71- config: {
72- decimal: ' .' ,
73- separator: ' ,' ,
74- prefix: ' $' ,
75- suffix: ' %' ,
76- precision: 2 ,
77- masked: false
78- }
79- }
80- },
81- methods: {
82- change (evt ) {
83- console .log (' change' , evt .target .value );
84- }
69+ data () {
70+ return {
71+ price: 0 ,
72+ priceDirective: 5432.1 ,
73+ priceUnmasked: 6789.10 ,
74+ config: {
75+ decimal: ' .' ,
76+ separator: ' ,' ,
77+ prefix: ' $' ,
78+ suffix: ' %' ,
79+ precision: 2 ,
80+ masked: false
81+ }
82+ }
83+ },
84+ methods: {
85+ change (evt ) {
86+ console .log (' change' , evt .target .value );
8587 }
88+ }
8689}
8790 </script >
8891
@@ -91,4 +94,4 @@ export default {
9194 min-width : 800px ;
9295 max-width : 95vw ;
9396 }
94- </style >
97+ </style >
0 commit comments