This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/vuetify/lib/components/VCounter/VCounter.js
2019-08-11 20:48:02 +02:00

37 lines
No EOL
875 B
JavaScript

// Styles
import "../../../src/components/VCounter/VCounter.sass"; // Mixins
import Themeable, { functionalThemeClasses } from '../../mixins/themeable';
import mixins from '../../util/mixins';
/* @vue/component */
export default mixins(Themeable).extend({
name: 'v-counter',
functional: true,
props: {
value: {
type: [Number, String],
default: ''
},
max: [Number, String]
},
render(h, ctx) {
const {
props
} = ctx;
const max = parseInt(props.max, 10);
const value = parseInt(props.value, 10);
const content = max ? `${value} / ${max}` : String(props.value);
const isGreater = max && value > max;
return h('div', {
staticClass: 'v-counter',
class: {
'error--text': isGreater,
...functionalThemeClasses(ctx)
}
}, content);
}
});
//# sourceMappingURL=VCounter.js.map