<template>
    <el-transfer
        v-model="model"
        :data="row.options()"
        :left-default-checked="row.leftDefaultChecked"
        :right-default-checked="row.rightDefaultChecked"
        @change="handleChange" />
</template>
<script lang="ts">
import { defineComponent, ref, PropType } from 'vue'
import useModel from '../../../script/help/useModel'
import { TransferInterface } from './index'
export default defineComponent({
    name: 'InfoTransfer',
    props: {
        row: {
            type: Object as PropType<TransferInterface>,
            default: () => {}
        },
        modelData: {
            type: Object,
            default: () => {}
        },
        addIndex: { // addform Index
            type: [Number, String],
            default: () => ''
        }
    },
    setup (props) {
        const { row, modelData } = props
        const model = useModel(modelData, row.model, row.deepData, props.addIndex, row)
        const handleChange = () => {
            row.methods?.()
        }
        return {
            model,
            handleChange
        }
    }
})
</script>
<style lang="scss">
</style>
