Vuetify: [Feature Request] Should allow defining default props globally like dense, outlined etc. (good to have)

Created on 13 Nov 2019  路  7Comments  路  Source: vuetifyjs/vuetify

Problem to solve

Don't have to set props every time like outlined, dense

Proposed solution

Should allow defining default props globally

new Vuetify({ default: { props: { dense: true, outlined: true } } })

Epic Framework feature

Most helpful comment

It is in the roadmap, It will be coming around Q1 of 2020 in v2.3 Release (Orion)

All 7 comments

It is in the roadmap, It will be coming around Q1 of 2020 in v2.3 Release (Orion)

what is default props?

Problem to solve

Don't have to set props every time like outlined, dense

Proposed solution

Should allow defining default props globally

new Vuetify({ default: { props: { dense: true, outlined: true } } })

is not work:
// vuetify.js
import Vue from 'vue';
import Vuetify from 'vuetify/lib';
import i18n from './i18n';
Vue.use(Vuetify);
export default new Vuetify({
lang: {
t: (key, ...params) => i18n.t(key, params),
},
// is not work...
default: {
props: { color: 'primary' }
}
});

// xx.vue <v-row> <v-toolbar dense> <v-btn>Test</v-btn> </v-toolbar> </v-row>

@KaelWD just to be clear for everyone, is this now possible with presets in v2.2?

@husayt This is not possible right now with presets. Presets do provide configuration to the options, but only already available options. Its on the roadmap slated for v3.1.

hi there!
this feature not workin in @nuxt/vuetify ?
i use @nuxt/vuetify version 2.0.0-beta.2

I tried setting my nuxt.config.js like below, but dense remains false

nuxt.config.js vuetify: { customVariables: ['~/assets/styles/variables.sass'], frameworkOptions: { theme: { themes: { light: { primary: colors.teal.darken2, accent: colors.grey.darken3, secondary: colors.amber.darken3, info: colors.cyan.darken1, warning: colors.amber.base, error: colors.deepOrange.accent4, success: colors.green.darken1 } } }, default: { props: { dense: true, outlined: true } } } }

is there any workaround other than applying the property to each component?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

efootstep picture efootstep  路  3Comments

cawa-93 picture cawa-93  路  3Comments

aaronjpitts picture aaronjpitts  路  3Comments

ricardovanlaarhoven picture ricardovanlaarhoven  路  3Comments

jofftiquez picture jofftiquez  路  3Comments