naive-ui icon indicating copy to clipboard operation
naive-ui copied to clipboard

Support prop name for all form fields

Open gimler opened this issue 2 years ago • 1 comments

This function solves the problem (这个功能解决的问题)

I try to use some components in a legacy application. I need to set the input field attribute name.

Actually it is possible for radio see https://www.naiveui.com/en-US/os-theme/components/radio#API.

Status (not complete):

  • autocomplete (workaround input-props)
  • color picker (not possible)
  • checkbox (not possible)
  • date picker (not possible)
  • select (workaround input-props)
  • slider (not possible)
  • switch (not possible)
  • upload (workaround input-props)

Expected API (期望的 API)

prop name see radio implementation. For multiple fields (date picker or dynamic inputs) save as array.

gimler avatar May 23 '22 19:05 gimler

I think you may add hidden input for components without input. For example <input type="hidden" name="xxx" :value="selectValue" />.

I'm not sure we will finally provide input-props for all listed components.

07akioni avatar Jun 01 '22 16:06 07akioni

This issue does not have any recent activity. If you are still experiencing similar problems, open a new error, including a minimal copy of the problem

jahnli avatar Mar 12 '24 13:03 jahnli