File tree Expand file tree Collapse file tree 3 files changed +35
-9
lines changed Expand file tree Collapse file tree 3 files changed +35
-9
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
28
28
<script setup>
29
29
import { computed , onMounted } from ' vue'
30
30
import { useRoute } from ' vue-router'
31
- import { useJobTheme , useReducedAnimation } from ' @/composables/localStorage'
31
+ import { useJobTheme } from ' @/composables/localStorage'
32
+ import { useDynamicVuetifyDefaults } from ' @/plugins/vuetify'
32
33
33
34
const DEFAULT_LAYOUT = ' empty'
34
35
const route = useRoute ()
@@ -39,14 +40,7 @@ const showSidebar = computed(() => route.meta.showSidebar ?? true)
39
40
40
41
const jobTheme = useJobTheme ()
41
42
42
- const reducedAnimation = useReducedAnimation ()
43
-
44
- const vuetifyDefaults = computed (() => ({
45
- global: {
46
- transition: reducedAnimation .value ? ' no' : undefined ,
47
- ripple: reducedAnimation .value ? false : undefined ,
48
- }
49
- }))
43
+ const vuetifyDefaults = useDynamicVuetifyDefaults ()
50
44
51
45
onMounted (() => {
52
46
// apply stored application font-size
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
-->
17
17
18
18
<template >
19
+ <!-- Have to repeat these defaults as the ones set in App.vue don't make it through
20
+ the parent v-dialog - see https://github.com/vuetifyjs/vuetify/issues/18123 -->
21
+ <v-defaults-provider :defaults =" vuetifyDefaults" >
19
22
<v-card >
20
23
<!-- the mutation title -->
21
24
<v-card-title class =" py-3" >
@@ -121,6 +124,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
121
124
</template >
122
125
</v-snackbar >
123
126
</v-card >
127
+ </v-defaults-provider >
124
128
</template >
125
129
126
130
<script >
@@ -133,6 +137,7 @@ import {
133
137
mutationStatus
134
138
} from ' @/utils/aotf'
135
139
import { mdiClose } from ' @mdi/js'
140
+ import { useDynamicVuetifyDefaults } from ' @/plugins/vuetify'
136
141
137
142
export default {
138
143
name: ' mutation' ,
@@ -171,6 +176,14 @@ export default {
171
176
},
172
177
},
173
178
179
+ setup () {
180
+ const vuetifyDefaults = useDynamicVuetifyDefaults ()
181
+
182
+ return {
183
+ vuetifyDefaults,
184
+ }
185
+ },
186
+
174
187
data : () => ({
175
188
isValid: false ,
176
189
submitting: false ,
Original file line number Diff line number Diff line change 15
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
*/
17
17
18
+ import { computed } from 'vue'
18
19
import { aliases , mdi } from 'vuetify/iconsets/mdi-svg'
19
20
import { VAutocomplete } from 'vuetify/components/VAutocomplete'
20
21
import { VCombobox } from 'vuetify/components/VCombobox'
@@ -23,6 +24,7 @@ import { VTextarea } from 'vuetify/components/VTextarea'
23
24
import { VTextField } from 'vuetify/components/VTextField'
24
25
import colors from 'vuetify/util/colors'
25
26
import { mdiClose } from '@mdi/js'
27
+ import { useReducedAnimation } from '@/composables/localStorage'
26
28
27
29
const inputDefaults = Object . fromEntries ( [
28
30
VAutocomplete ,
@@ -76,3 +78,20 @@ export const vuetifyOptions = {
76
78
...inputDefaults
77
79
} ,
78
80
}
81
+
82
+ /**
83
+ * Composable that provides Vuetify defaults that can change at runtime, as opposed to
84
+ * the static defaults provided in `createVuetify(vuetifyOptions)`.
85
+ *
86
+ * For use with a v-defaults-provider.
87
+ */
88
+ export function useDynamicVuetifyDefaults ( ) {
89
+ const reducedAnimation = useReducedAnimation ( )
90
+
91
+ return computed ( ( ) => ( {
92
+ global : {
93
+ transition : reducedAnimation . value ? 'no' : undefined ,
94
+ ripple : reducedAnimation . value ? false : undefined ,
95
+ }
96
+ } ) )
97
+ }
You can’t perform that action at this time.
0 commit comments