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/>.
2828<script setup>
2929import { computed , onMounted } from ' vue'
3030import { useRoute } from ' vue-router'
31- import { useJobTheme , useReducedAnimation } from ' @/composables/localStorage'
31+ import { useJobTheme } from ' @/composables/localStorage'
32+ import { useDynamicVuetifyDefaults } from ' @/plugins/vuetify'
3233
3334const DEFAULT_LAYOUT = ' empty'
3435const route = useRoute ()
@@ -39,14 +40,7 @@ const showSidebar = computed(() => route.meta.showSidebar ?? true)
3940
4041const jobTheme = useJobTheme ()
4142
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 ()
5044
5145onMounted (() => {
5246 // 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/>.
1616-->
1717
1818<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" >
1922 <v-card >
2023 <!-- the mutation title -->
2124 <v-card-title class =" py-3" >
@@ -121,6 +124,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
121124 </template >
122125 </v-snackbar >
123126 </v-card >
127+ </v-defaults-provider >
124128</template >
125129
126130<script >
@@ -133,6 +137,7 @@ import {
133137 mutationStatus
134138} from ' @/utils/aotf'
135139import { mdiClose } from ' @mdi/js'
140+ import { useDynamicVuetifyDefaults } from ' @/plugins/vuetify'
136141
137142export default {
138143 name: ' mutation' ,
@@ -171,6 +176,14 @@ export default {
171176 },
172177 },
173178
179+ setup () {
180+ const vuetifyDefaults = useDynamicVuetifyDefaults ()
181+
182+ return {
183+ vuetifyDefaults,
184+ }
185+ },
186+
174187 data : () => ({
175188 isValid: false ,
176189 submitting: false ,
Original file line number Diff line number Diff line change 1515 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1616 */
1717
18+ import { computed } from 'vue'
1819import { aliases , mdi } from 'vuetify/iconsets/mdi-svg'
1920import { VAutocomplete } from 'vuetify/components/VAutocomplete'
2021import { VCombobox } from 'vuetify/components/VCombobox'
@@ -23,6 +24,7 @@ import { VTextarea } from 'vuetify/components/VTextarea'
2324import { VTextField } from 'vuetify/components/VTextField'
2425import colors from 'vuetify/util/colors'
2526import { mdiClose } from '@mdi/js'
27+ import { useReducedAnimation } from '@/composables/localStorage'
2628
2729const inputDefaults = Object . fromEntries ( [
2830 VAutocomplete ,
@@ -76,3 +78,20 @@ export const vuetifyOptions = {
7678 ...inputDefaults
7779 } ,
7880}
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