bootstrap-vue
Version:
With more than 85 components, over 45 available plugins, several directives, and 1000+ icons, BootstrapVue provides one of the most comprehensive implementations of the Bootstrap v4 component and grid system available for Vue.js v2.6, complete with extens
46 lines (44 loc) • 1.15 kB
JavaScript
import Vue, { mergeData } from '../../vue'
import { NAME_DROPDOWN_FORM } from '../../constants/components'
import { BForm, props as formProps } from '../form/form'
// @vue/component
export const BDropdownForm = /*#__PURE__*/ Vue.extend({
name: NAME_DROPDOWN_FORM,
functional: true,
props: {
...formProps,
disabled: {
type: Boolean,
default: false
},
formClass: {
type: [String, Object, Array]
// default: null
}
},
render(h, { props, data, children }) {
const $attrs = data.attrs || {}
const $listeners = data.on || {}
data.attrs = {}
data.on = {}
return h('li', mergeData(data, { attrs: { role: 'presentation' } }), [
h(
BForm,
{
ref: 'form',
staticClass: 'b-dropdown-form',
class: [props.formClass, { disabled: props.disabled }],
props,
attrs: {
...$attrs,
disabled: props.disabled,
// Tab index of -1 for keyboard navigation
tabindex: props.disabled ? null : '-1'
},
on: $listeners
},
children
)
])
}
})