@gitlab/ui
Version:
GitLab UI Components
42 lines (36 loc) • 859 B
JavaScript
import { extend, mergeData } from '../../vue';
import { NAME_DROPDOWN_DIVIDER } from '../../constants/components';
import { omit } from '../../utils/object';
// --- Props ---
const props = {
tag: {
type: String,
required: false,
default: 'hr'
}
};
// --- Main component ---
// @vue/component
const BDropdownDivider = /*#__PURE__*/extend({
name: NAME_DROPDOWN_DIVIDER,
functional: true,
props,
render(h, _ref) {
let props = _ref.props,
data = _ref.data;
return h('li', mergeData(omit(data, ['attrs']), {
attrs: {
role: 'presentation'
}
}), [h(props.tag, {
staticClass: 'dropdown-divider',
attrs: {
...(data.attrs || {}),
role: 'separator',
'aria-orientation': 'horizontal'
},
ref: 'divider'
})]);
}
});
export { BDropdownDivider, props };