11<template >
2- <div class =" q-gutter-y-sm" >
3- <div class =" column" >
4- <div class =" text-h6" >Component</div >
5- <number
6- @update:model-value =" (val) => (price = val)"
7- class =" q-field__input"
8- :model-value =" price"
9- v-bind =" config"
10- />
11- <div >
12- Model value: <span class =" text-bold" >{{ price }}</span >
13- </div >
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 dense outlined v-model =" price" >
8+ <template
9+ v-slot :control =" { id , floatingLabel , modelValue , emitValue } "
10+ >
11+ <number
12+ :id =" id"
13+ class =" q-field__input"
14+ :modelValue =" modelValue"
15+ @update:model-value =" emitValue"
16+ v-bind =" config"
17+ v-show =" floatingLabel"
18+ />
19+ </template >
20+ </q-field >
21+ <div >
22+ Model value: <span class =" text-bold" >{{ price }}</span >
23+ </div >
24+ </div >
25+ <div class =" column" >
26+ <div class =" text-h6" >Reverse Fill</div >
27+ <q-field dense outlined v-model =" reverseFill" >
28+ <template
29+ v-slot :control =" { id , floatingLabel , modelValue , emitValue } "
30+ >
31+ <number
32+ :id =" id"
33+ class =" q-field__input"
34+ :modelValue =" modelValue"
35+ @update:model-value =" emitValue"
36+ v-bind =" configReverseFill"
37+ v-show =" floatingLabel"
38+ />
39+ </template >
40+ </q-field >
41+ <div >
42+ Model value: <span class =" text-bold" >{{ reverseFill }}</span >
43+ </div >
44+ </div >
45+ <div class =" column" >
46+ <div class =" text-h6" >Directive</div >
47+ <q-field dense outlined hint =" masking doesn't work with directive" >
48+ <template v-slot :control >
49+ <input
50+ type =" tel"
51+ class =" q-field__input"
52+ v-number =" config"
53+ :value =" priceDirective"
54+ @change =" ({ target }) => (priceDirective = target.value)"
55+ />
56+ </template >
57+ </q-field >
58+ <div >
59+ Model value: <span class =" text-bold" >{{ priceDirective }}</span >
60+ </div >
61+ </div >
62+ </q-list >
1463 </div >
15- <div class =" column" >
16- <div class =" text-h6" >Reverse Fill</div >
17- <number
18- @update:model-value =" (val) => (price = val)"
19- class =" q-field__input"
20- :model-value =" reverseFill"
21- v-bind =" configReverseFill"
22- />
23- <div >
24- Model value: <span class =" text-bold" >{{ reverseFill }}</span >
25- </div >
26- </div >
27- <div class =" column" >
28- <div class =" text-h6" >Directive</div >
29- <input
30- type =" text"
31- class =" q-field__input"
32- v-number =" config"
33- :value =" priceDirective"
34- @change =" ({ target }) => (priceDirective = target.value)"
35- />
36- <div >masking doesn't work with directive</div >
37- <div >
38- Model value: <span class =" text-bold" >{{ priceDirective }}</span >
39- </div >
64+ <div class =" col-sm-4 col-xs-12" >
65+ <q-list class =" q-gutter-y-sm" >
66+ <q-input dense v-model =" config.prefix" type =" text" label =" Prefix" />
67+ <q-input dense v-model =" config.suffix" type =" text" label =" Suffix" />
68+ <q-input
69+ dense
70+ v-model.number =" config.precision"
71+ type =" number"
72+ min =" 0"
73+ max =" 5"
74+ label =" Precision"
75+ />
76+ <q-input dense v-model =" config.decimal" type =" text" label =" Decimal" />
77+ <q-input
78+ dense
79+ v-model =" config.separator"
80+ type =" text"
81+ label =" Separator"
82+ />
83+ <q-checkbox dense v-model =" config.masked" label =" Masked" />
84+ <q-checkbox dense v-model =" config.reverseFill" label =" Reverse Fill" />
85+ </q-list >
4086 </div >
4187 </div >
4288</template >
@@ -46,7 +92,7 @@ export default {
4692 data () {
4793 return {
4894 price: 154.52 ,
49- priceDirective: 6789.1 ,
95+ priceDirective: 536.59 ,
5096 priceUnmasked: 6789.1 ,
5197 config: {
5298 decimal: " ." ,
@@ -65,10 +111,12 @@ export default {
65111 },
66112 };
67113 },
68- methods: {
69- onChange (args ) {
70- console .log (" args" , args);
71- },
72- },
73114};
74115 </script >
116+
117+ <style lang="css">
118+ .container {
119+ min-width : 800px ;
120+ max-width : 95vw ;
121+ }
122+ </style >
0 commit comments