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
46 lines (44 loc) • 1.13 kB
JavaScript
import Vue from '../../utils/vue'
import { mergeData } from 'vue-functional-data-merge'
import { BForm, props as formProps } from '../form/form'
// @vue/component
export const BDropdownForm = /*#__PURE__*/ Vue.extend({
name: 'BDropdownForm',
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
)
])
}
})