UNPKG

@coreui/vue

Version:

UI Components Library for Vue.js

47 lines (43 loc) 1.43 kB
'use strict'; var vue = require('vue'); const CHeader = vue.defineComponent({ name: 'CHeader', props: { /** * Component used for the root node. Either a string to use a HTML element or a component. */ as: { type: String, default: 'div', }, /** * Defines optional container wrapping children elements. * * @values boolean, 'sm', 'md', 'lg', 'xl', 'xxl', 'fluid' */ container: { type: [Boolean, String], validator: (value) => { return (typeof value === 'boolean' || ['sm', 'md', 'lg', 'xl', 'xxl', 'fluid'].includes(value)); }, }, /** * Place header in non-static positions. * * @values 'fixed', 'sticky' */ position: { type: String, validator: (value) => { return ['fixed', 'sticky'].includes(value); }, }, }, setup(props, { slots }) { return () => vue.h(props.as, { class: ['header', { [`header-${props.position}`]: props.position }] }, props.container ? vue.h('div', { class: `container${props.container === true ? '' : '-' + props.container}` }, slots.default && slots.default()) : slots.default && slots.default()); }, }); exports.CHeader = CHeader; //# sourceMappingURL=CHeader.js.map