Skip to content

Instantly share code, notes, and snippets.

@MrJmpl3
Created September 13, 2019 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrJmpl3/48013cbe7acec12199943862347e84d0 to your computer and use it in GitHub Desktop.
Save MrJmpl3/48013cbe7acec12199943862347e84d0 to your computer and use it in GitHub Desktop.
Applying the advice of Vuetify
import mixins from 'vuetify/src/util/mixins';
import VTextField from 'vuetify/lib/components/VTextField';
import VInput from 'vuetify/lib/components/VInput';
export default mixins(VTextField)
.extend()
.extend({
name: 'CtTextField',
props: {
dense: {
type: Boolean,
default: false
},
color: {
type: String,
default: 'secondary'
}
},
computed: {
classes() {
return {
...VInput.options.computed.classes.call(this),
'v-text-field': true,
'v-text-field--full-width': this.fullWidth,
'v-text-field--prefix': this.prefix,
'v-text-field--single-line': this.isSingle,
'v-text-field--solo': this.isSolo,
'v-text-field--solo-inverted': this.soloInverted,
'v-text-field--solo-flat': this.flat,
'v-text-field--filled': this.filled,
'v-text-field--is-booted': this.isBooted,
'v-text-field--enclosed': this.isEnclosed,
'v-text-field--reverse': this.reverse,
'v-text-field--outlined': this.outlined,
'v-text-field--placeholder': this.placeholder,
'v-text-field--rounded': this.rounded,
'v-text-field--shaped': this.shaped,
'ct-text-field': true,
'ct-text-field--dense': this.dense
};
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment