| | |
| | | </template> |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | <script lang="ts" setup> |
| | | import type { CSSProperties } from 'vue'; |
| | | import { defineComponent, computed } from 'vue'; |
| | | import { useDesign } from '/@/hooks/web/useDesign'; |
| | | |
| | | import { computed } from 'vue'; |
| | | import { useDesign } from '@/hooks/web/useDesign'; |
| | | import { footerProps } from '../props'; |
| | | |
| | | export default defineComponent({ |
| | | name: 'BasicDrawerFooter', |
| | | props: { |
| | | ...footerProps, |
| | | height: { |
| | | type: String, |
| | | default: '60px', |
| | | }, |
| | | }, |
| | | emits: ['ok', 'close'], |
| | | setup(props, { emit }) { |
| | | const { prefixCls } = useDesign('basic-drawer-footer'); |
| | | defineOptions({ name: 'BasicDrawerFooter' }); |
| | | |
| | | const getStyle = computed((): CSSProperties => { |
| | | const heightStr = `${props.height}`; |
| | | return { |
| | | height: heightStr, |
| | | lineHeight: `calc(${heightStr} - 1px)`, |
| | | }; |
| | | }); |
| | | |
| | | function handleOk() { |
| | | emit('ok'); |
| | | } |
| | | |
| | | function handleClose() { |
| | | emit('close'); |
| | | } |
| | | return { handleOk, prefixCls, handleClose, getStyle }; |
| | | const props = defineProps({ |
| | | ...footerProps, |
| | | height: { |
| | | type: String, |
| | | default: '60px', |
| | | }, |
| | | }); |
| | | |
| | | const emit = defineEmits(['ok', 'close']); |
| | | |
| | | const { prefixCls } = useDesign('basic-drawer-footer'); |
| | | |
| | | const getStyle = computed((): CSSProperties => { |
| | | const heightStr = `${props.height}`; |
| | | return { |
| | | height: heightStr, |
| | | lineHeight: `calc(${heightStr} - 1px)`, |
| | | }; |
| | | }); |
| | | |
| | | function handleOk() { |
| | | emit('ok'); |
| | | } |
| | | |
| | | function handleClose() { |
| | | emit('close'); |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | |
| | | .@{prefix-cls} { |
| | | position: absolute; |
| | | bottom: 0; |
| | | left: 0; |
| | | width: 100%; |
| | | padding: 0 12px 0 20px; |
| | | border-top: 1px solid @border-color-base; |