Don't have to set props every time like outlined, dense
Should allow defining default props globally
new Vuetify({
default: {
props: {
dense: true,
outlined: true
}
}
})
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?
Most helpful comment
It is in the roadmap, It will be coming around Q1 of 2020 in v2.3 Release (Orion)