1+ <script setup>
2+ import { ref , computed } from " vue" ;
3+ import LocalVueUiDigits from " ../src/components/vue-ui-digits.vue" ;
4+ import LocalVueDataUi from ' ../src/components/vue-data-ui.vue' ;
5+ import Box from " ./Box.vue" ;
6+ import convertArrayToObject from " ./convertModel" ;
7+ import { VueUiDigits } from " vue-data-ui" ;
8+ import { VueUiDigits as VueUiDigitsTreeshaken } from " vue-data-ui/vue-ui-digits" ;
9+ import ConfigKnobs from " ./ConfigKnobs.vue" ;
10+ import { useConfigurationControls } from " ./createConfigModel" ;
11+ import { useConfig } from " ../src/useConfig"
12+
13+ const { vue_ui_digits: DEFAULT_CONFIG } = useConfig ();
14+
15+ const {
16+ RANGE ,
17+ TEXT ,
18+ COLOR ,
19+ createModel
20+ } = useConfigurationControls (DEFAULT_CONFIG );
21+
22+ const dataset = ref (0.123456789 );
23+
24+ const model = createModel ([
25+ TEXT (' height' , { def: ' 100%' }),
26+ TEXT (' width' , { def: null }),
27+ COLOR (' backgroundColor' , { def: ' #FFFFFF ' }),
28+ COLOR (' digits.color' , { def: ' #1A1A1A' }),
29+ COLOR (' digits.skeletonColor' , { def: ' #E1E5E8' }),
30+ RANGE (' digits.thickness' , { def: 1 , step: 0.1 , min: 0.1 , max: 3 })
31+ ]);
32+
33+ const config = computed (() => {
34+ const c = convertArrayToObject (model .value );
35+ return {
36+ ... c
37+ }
38+ })
39+
40+ </script >
41+
42+ <template >
43+ <Box comp =" VueUiDigits" :dataset =" dataset" :config =" config" >
44+ <template #title >VueUiDigits</template >
45+
46+ <template #responsive >
47+ <div style =" width : 300px ; height : 80px ; resize : both ; overflow : auto ; background : white " >
48+ <LocalVueUiDigits :dataset =" dataset" :config =" {
49+ width: '100%',
50+ height: '100%'
51+ }" />
52+ </div >
53+ </template >
54+
55+ <template #local >
56+ <LocalVueUiDigits :dataset =" dataset" :config =" config" />
57+ </template >
58+
59+ <template #VDUI-local >
60+ <LocalVueDataUi component =" VueUiDigits" :dataset =" dataset" :config =" config" />
61+ </template >
62+
63+ <template #build >
64+ <VueUiDigits :dataset =" dataset" :config =" config" />
65+ </template >
66+
67+ <template #build-treesh >
68+ <VueUiDigitsTreeshaken :dataset =" dataset" :config =" config" />
69+ </template >
70+
71+ <template #VDUI-build >
72+ <VueDataUi component =" VueUiDigits" :dataset =" dataset" :config =" config" />
73+ </template >
74+
75+ <template #knobs >
76+ <ConfigKnobs :model =" model" @change =" step += 1" />
77+ </template >
78+ </Box >
79+ </template >
0 commit comments