index.jsx 895 B

123456789101112131415161718192021222324252627282930
  1. import { defineComponent } from 'vue'
  2. import { formInputProps, fromInputEmits } from '../../form-input-props'
  3. import { useFormInput } from '@cip/components/hooks/form-input'
  4. import { ElInput } from 'element-plus'
  5. import './index.less'
  6. export default defineComponent({
  7. props: formInputProps,
  8. emits: [...fromInputEmits],
  9. setup (props, context) {
  10. const { proxyValue, proxyOtherValue } = useFormInput(props, context)
  11. return () => <div class={'basic-link'}>
  12. <ElInput
  13. class={'basic-link__name'}
  14. v-model={proxyOtherValue[0].value}
  15. clearable={true}>
  16. {{
  17. prepend: () => <span>链接名称</span>
  18. }}
  19. </ElInput>
  20. <ElInput
  21. class={'basic-link__href'}
  22. v-model={proxyValue.value}
  23. clearable={true}>
  24. {{
  25. prepend: () => <span>链接地址</span>
  26. }}
  27. </ElInput>
  28. </div>
  29. }
  30. })