表單欄位
CommonFormField 負責 label 與錯誤訊息,CommonFormControl 負責輸入本身。兩者搭配使用,不要各自單獨用。
欄位容器
CommonFormFieldcomponents/Common/Form/Field.vue
把 label、必填標記、錯誤訊息集中在這一層, 裡面放什麼控制項都可以。錯誤訊息同時傳給 Field 與 Control —— 前者負責顯示文字,後者負責把邊框變成錯誤色。
搭配 Control 使用
Props
Slots
輸入控制項
CommonFormControlcomponents/Common/Form/Control.vue
全站的輸入框都走這一個元件,用 type 切換行為。 兩種下拉的差別:select 是客製化選單 (含 floating-ui 轉向偵測,樣式可控), ogSelect 是原生 <select> 改外觀 (行動裝置上會叫出系統選單,體驗較好)。
文字輸入
密碼(可切換明碼)
錯誤狀態
請輸入正確的 Email 格式
Props
* 為必填
Events
多行輸入
CommonFormTextAreacomponents/Common/Form/TextArea.vue
傳 maxlength 時會自動顯示字數計數。
含字數上限
Props
* 為必填
