File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
src/playground/configs/components Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ <template >
2+ <v-btn-toggle
3+ v-model =" selectedColor"
4+ density =" compact"
5+ divided
6+ >
7+ <v-btn
8+ v-for =" (themeColor, themeName) in themeColors"
9+ :key =" themeName"
10+ :color =" themeColor"
11+ size =" small"
12+ :value =" themeName"
13+ @click =" emitUpdate"
14+ >{{ themeName }}</v-btn >
15+ </v-btn-toggle >
16+ </template >
17+
18+ <script setup lang="ts">
19+ /* eslint-disable vue/sort-keys */
20+ import {
21+ ref ,
22+ unref ,
23+ } from ' vue' ;
24+ import { useTheme } from ' vuetify' ;
25+
26+
27+ const emit = defineEmits ([' update' ]);
28+ const theme = useTheme ();
29+
30+ const selectedColor = ref (' primary' );
31+ const { colors } = unref (theme .current );
32+
33+ const themeColors = ref ({
34+ primary: colors .primary ,
35+ secondary: colors .secondary ,
36+ success: colors .success ,
37+ accent: colors .accent ,
38+ info: colors .info ,
39+ warning: colors .warning ,
40+ danger: colors .danger ,
41+ error: colors .error ,
42+ });
43+
44+ function emitUpdate() {
45+ emit (' update' , selectedColor .value );
46+ }
47+ </script >
You can’t perform that action at this time.
0 commit comments