xuziqiang
6 months ago
3 changed files with 39 additions and 2 deletions
@ -0,0 +1,34 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<a-drawer v-bind="getBindValue"> |
|||
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item"> |
|||
<slot :name="item" v-bind="data || {}"></slot> |
|||
</template> |
|||
<template #footer> |
|||
<a-button>取消</a-button> |
|||
</template> |
|||
</a-drawer> |
|||
</template> |
|||
|
|||
<script lang="ts"> |
|||
import { computed, defineComponent, toRefs } from 'vue'; |
|||
import { drawerProps } from 'ant-design-vue/es/drawer'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'NsDrawer', |
|||
props: { |
|||
...drawerProps(), |
|||
}, |
|||
setup(props, { attrs, emit, slots }) { |
|||
console.log(props, slots); |
|||
|
|||
const getBindValue = computed(() => ({ |
|||
...attrs, |
|||
...props, |
|||
})); |
|||
return { getBindValue }; |
|||
}, |
|||
}); |
|||
</script> |
|||
<style lang="less" scoped></style> |
@ -0,0 +1,4 @@ |
|||
import drawer from './drawer.vue'; |
|||
import { withInstall } from '/nerv-lib/util'; |
|||
|
|||
export const NsDrawer = withInstall(drawer); |
Loading…
Reference in new issue