mirror of
https://github.com/element-plus/element-plus.git
synced 2025-03-01 15:35:51 +08:00
docs: [transfer] fix type error (#19682)
This commit is contained in:
parent
151fadd951
commit
add84b5694
@ -61,8 +61,11 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import type { VNode, VNodeProps } from 'vue'
|
||||
|
||||
import type {
|
||||
TransferDirection,
|
||||
TransferKey,
|
||||
renderContent,
|
||||
} from 'element-plus'
|
||||
interface Option {
|
||||
key: number
|
||||
label: string
|
||||
@ -85,16 +88,12 @@ const data = ref(generateData())
|
||||
const rightValue = ref([1])
|
||||
const leftValue = ref([1])
|
||||
|
||||
const renderFunc = (
|
||||
h: (type: string, props: VNodeProps | null, children?: string) => VNode,
|
||||
option: Option
|
||||
) => {
|
||||
return h('span', null, option.label)
|
||||
}
|
||||
const renderFunc: renderContent = (h, option) => h('span', null, option.label)
|
||||
|
||||
const handleChange = (
|
||||
value: number[] | string[],
|
||||
direction: 'left' | 'right',
|
||||
movedKeys: string[] | number[]
|
||||
value: TransferKey[],
|
||||
direction: TransferDirection,
|
||||
movedKeys: TransferKey[]
|
||||
) => {
|
||||
console.log(value, direction, movedKeys)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user