import { ref, h, reactive, PropType } from 'vue' import { defineVxeComponent } from '../../ui/src/comp' import { VxeUI } from '@vxe-ui/core' import XEUtils from 'xe-utils' import type { VxeLayoutFooterPropTypes, LayoutFooterReactData, LayoutFooterPrivateMethods, LayoutFooterMethods, VxeLayoutFooterEmits, LayoutFooterPrivateRef, VxeLayoutFooterPrivateComputed, VxeLayoutFooterConstructor, ValueOf, VxeLayoutFooterPrivateMethods } from '../../../types' const { createEvent } = VxeUI export default /* define-vxe-component start */ defineVxeComponent({ name: 'VxeLayoutFooter', props: { fixed: Boolean as PropType, align: String as PropType }, emits: [] as VxeLayoutFooterEmits, setup(props, context) { const { slots, emit } = context const xID = XEUtils.uniqueId() const refElem = ref() const reactData = reactive({}) const refMaps: LayoutFooterPrivateRef = { refElem } const computeMaps: VxeLayoutFooterPrivateComputed = {} const $xeLayoutFooter = { xID, props, context, reactData, getRefMaps: () => refMaps, getComputeMaps: () => computeMaps } as unknown as VxeLayoutFooterConstructor & VxeLayoutFooterPrivateMethods const dispatchEvent = (type: ValueOf, params: Record, evnt: Event | null) => { emit(type, createEvent(evnt, { $layoutFooter: $xeLayoutFooter }, params)) } const layoutFooterMethods: LayoutFooterMethods = { dispatchEvent } const layoutFooterPrivateMethods: LayoutFooterPrivateMethods = {} Object.assign($xeLayoutFooter, layoutFooterMethods, layoutFooterPrivateMethods) const renderVN = () => { const { fixed, align } = props const defaultSlot = slots.default return h( 'footer', { ref: refElem, class: [ 'vxe-layout-footer', align ? `align--${align}` : '', { 'is--fixed': fixed } ] }, defaultSlot ? defaultSlot({}) : [] ) } $xeLayoutFooter.renderVN = renderVN return $xeLayoutFooter }, render() { return this.renderVN() } }) /* define-vxe-component end */