bootstrap-vue
Version:
BootstrapVue, with over 40 plugins and more than 80 custom components, custom directives, and over 300 icons, provides one of the most comprehensive implementations of Bootstrap v4 components and grid system for Vue.js. With extensive and automated WAI-AR
79 lines (76 loc) • 1.79 kB
JavaScript
import Vue from '../../utils/vue'
import { getComponentConfig } from '../../utils/config'
import normalizeSlotMixin from '../../mixins/normalize-slot'
import { BProgressBar } from './progress-bar'
const NAME = 'BProgress'
// @vue/component
export const BProgress = /*#__PURE__*/ Vue.extend({
name: NAME,
mixins: [normalizeSlotMixin],
provide() {
return { bvProgress: this }
},
props: {
// These props can be inherited via the child b-progress-bar(s)
variant: {
type: String,
default: () => getComponentConfig(NAME, 'variant')
},
striped: {
type: Boolean,
default: false
},
animated: {
type: Boolean,
default: false
},
height: {
type: String,
default: null
},
precision: {
type: [Number, String],
default: 0
},
showProgress: {
type: Boolean,
default: false
},
showValue: {
type: Boolean,
default: false
},
max: {
type: [Number, String],
default: 100
},
// This prop is not inherited by child b-progress-bar(s)
value: {
type: [Number, String],
default: 0
}
},
computed: {
progressHeight() {
return { height: this.height || null }
}
},
render(h) {
let childNodes = this.normalizeSlot('default')
if (!childNodes) {
childNodes = h(BProgressBar, {
props: {
value: this.value,
max: this.max,
precision: this.precision,
variant: this.variant,
animated: this.animated,
striped: this.striped,
showProgress: this.showProgress,
showValue: this.showValue
}
})
}
return h('div', { class: ['progress'], style: this.progressHeight }, [childNodes])
}
})