fix: `slots` working in components
修复vue新版本改动导致组件传递slots可能出现错误的问题
This commit is contained in:
parent
93f9a19aa1
commit
b1f31762e3
|
|
@ -4,7 +4,7 @@
|
||||||
<CountButton :size="size" :count="count" :value="state" :beforeStartFunc="sendCodeApi" />
|
<CountButton :size="size" :count="count" :value="state" :beforeStartFunc="sendCodeApi" />
|
||||||
</template>
|
</template>
|
||||||
<template #[item]="data" v-for="item in Object.keys($slots).filter((k) => k !== 'addonAfter')">
|
<template #[item]="data" v-for="item in Object.keys($slots).filter((k) => k !== 'addonAfter')">
|
||||||
<slot :name="item" v-bind="data"></slot>
|
<slot :name="item" v-bind="data || {}"></slot>
|
||||||
</template>
|
</template>
|
||||||
</a-input>
|
</a-input>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
</ScrollContainer>
|
</ScrollContainer>
|
||||||
<DrawerFooter v-bind="getProps" @close="onClose" @ok="handleOk" :height="getFooterHeight">
|
<DrawerFooter v-bind="getProps" @close="onClose" @ok="handleOk" :height="getFooterHeight">
|
||||||
<template #[item]="data" v-for="item in Object.keys($slots)">
|
<template #[item]="data" v-for="item in Object.keys($slots)">
|
||||||
<slot :name="item" v-bind="data"></slot>
|
<slot :name="item" v-bind="data || {}"></slot>
|
||||||
</template>
|
</template>
|
||||||
</DrawerFooter>
|
</DrawerFooter>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
:setFormModel="setFormModel"
|
:setFormModel="setFormModel"
|
||||||
>
|
>
|
||||||
<template #[item]="data" v-for="item in Object.keys($slots)">
|
<template #[item]="data" v-for="item in Object.keys($slots)">
|
||||||
<slot :name="item" v-bind="data"></slot>
|
<slot :name="item" v-bind="data || {}"></slot>
|
||||||
</template>
|
</template>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
v-model:value="state"
|
v-model:value="state"
|
||||||
>
|
>
|
||||||
<template #[item]="data" v-for="item in Object.keys($slots)">
|
<template #[item]="data" v-for="item in Object.keys($slots)">
|
||||||
<slot :name="item" v-bind="data"></slot>
|
<slot :name="item" v-bind="data || {}"></slot>
|
||||||
</template>
|
</template>
|
||||||
<template #suffixIcon v-if="loading">
|
<template #suffixIcon v-if="loading">
|
||||||
<LoadingOutlined spin />
|
<LoadingOutlined spin />
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<a-tree-select v-bind="getAttrs" @change="handleChange">
|
<a-tree-select v-bind="getAttrs" @change="handleChange">
|
||||||
<template #[item]="data" v-for="item in Object.keys($slots)">
|
<template #[item]="data" v-for="item in Object.keys($slots)">
|
||||||
<slot :name="item" v-bind="data"></slot>
|
<slot :name="item" v-bind="data || {}"></slot>
|
||||||
</template>
|
</template>
|
||||||
<template #suffixIcon v-if="loading">
|
<template #suffixIcon v-if="loading">
|
||||||
<LoadingOutlined spin />
|
<LoadingOutlined spin />
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
<template #footer v-if="!$slots.footer">
|
<template #footer v-if="!$slots.footer">
|
||||||
<ModalFooter v-bind="getBindValue" @ok="handleOk" @cancel="handleCancel">
|
<ModalFooter v-bind="getBindValue" @ok="handleOk" @cancel="handleCancel">
|
||||||
<template #[item]="data" v-for="item in Object.keys($slots)">
|
<template #[item]="data" v-for="item in Object.keys($slots)">
|
||||||
<slot :name="item" v-bind="data"></slot>
|
<slot :name="item" v-bind="data || {}"></slot>
|
||||||
</template>
|
</template>
|
||||||
</ModalFooter>
|
</ModalFooter>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
<slot name="headerContent" v-else></slot>
|
<slot name="headerContent" v-else></slot>
|
||||||
</template>
|
</template>
|
||||||
<template #[item]="data" v-for="item in getHeaderSlots">
|
<template #[item]="data" v-for="item in getHeaderSlots">
|
||||||
<slot :name="item" v-bind="data"></slot>
|
<slot :name="item" v-bind="data || {}"></slot>
|
||||||
</template>
|
</template>
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
>
|
>
|
||||||
<template #[item]="data" v-for="item in Object.keys($slots)">
|
<template #[item]="data" v-for="item in Object.keys($slots)">
|
||||||
<slot :name="item" v-bind="data"></slot>
|
<slot :name="item" v-bind="data || {}"></slot>
|
||||||
</template>
|
</template>
|
||||||
</InputPassword>
|
</InputPassword>
|
||||||
<div :class="`${prefixCls}-bar`">
|
<div :class="`${prefixCls}-bar`">
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
@change="handleTableChange"
|
@change="handleTableChange"
|
||||||
>
|
>
|
||||||
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
||||||
<slot :name="item" v-bind="data"></slot>
|
<slot :name="item" v-bind="data || {}"></slot>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #[`header-${column.dataIndex}`] v-for="column in columns" :key="column.dataIndex">
|
<template #[`header-${column.dataIndex}`] v-for="column in columns" :key="column.dataIndex">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue