import { defineComponent } from 'vue'
import { formInputProps } from '../../form-input-props'
import { useFormInput } from '@cip/components/hooks/form-input'
import { ElInput } from 'element-plus'
import './index.less'
export default defineComponent({
  props: formInputProps,
  setup (props, context) {
    const FormInput = useFormInput(props, context)
    return () => <div class={'basic-link'}>
      <ElInput
        class={'basic-link__name'}
        modelValue={props.otherValue}
        onUpdate:modelValue={FormInput.emitOtherValue}
        clearable={true}>
        {{
          prepend: () => <span>链接名称</span>
        }}
      </ElInput>
      <ElInput
        class={'basic-link__href'}
        modelValue={props.modelValue}
        onUpdate:modelValue={FormInput.emitInput}
        clearable={true}>
        {{
          prepend: () => <span>链接地址</span>
        }}
      </ElInput>
    </div>
  }
})
