From b35d23e07ac421395f1ffddb2f5dc91b3bbe5e2e Mon Sep 17 00:00:00 2001
From: Tevin <tingquanren@163.com>
Date: Tue, 23 Nov 2021 10:04:01 +0800
Subject: [PATCH] 完善超大字模式

---
 forms/input/CInput.vue |   46 +++++++++++++++++++++++++++++++---------------
 1 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/forms/input/CInput.vue b/forms/input/CInput.vue
index 38ec252..171f765 100644
--- a/forms/input/CInput.vue
+++ b/forms/input/CInput.vue
@@ -1,22 +1,33 @@
 /**
- * CInput
+ * CInput - 表单项,文本输入框
  * @author Tevin
  */
 
 <template>
-    <AtInput
-        :name="itemRes.name"
-        :title="itemRes.label"
-        :type="type"
-        :placeholder="placeholder"
-        :required="itemRes.required"
-        :error="itemRes.error"
-        :value="itemRes.formData[itemRes.name]"
-        :onChange="evt=>itemRes.onChange(evt)"
+    <view
+        class="c-input"
+        :class="unit?'c-input-unit':''"
     >
-        <slot />
-    </AtInput>
-</template><script>
+        <AtInput
+            :name="itemRes.name"
+            :title="itemRes.label"
+            :type="type"
+            :placeholder="placeholder"
+            :required="itemRes.required"
+            :error="itemRes.error"
+            :value="itemRes.formData[itemRes.name]"
+            :onChange="evt=>itemRes.onChange(evt)"
+        >
+            <slot v-if="!unit" />
+            <text
+                class="c-input-unit-text"
+                v-if="unit"
+            >{{unit}}</text>
+        </AtInput>
+    </view>
+</template>
+
+<script>
 import { AtInput } from 'taro-ui-vue';
 import './cInput.scss';
 
@@ -26,9 +37,14 @@
         AtInput,
     },
     props: {
-        type: String,
-        placeholder: String,
+        // 表单数据资源(表单组件内部机制专用)
         itemRes: Object,
+        // 输入框类型,text、number、password、phone、idcard、digit
+        type: String,
+        // 占位提示
+        placeholder: String,
+        // 输入框单位
+        unit: String,
     },
     mounted() {},
 };

--
Gitblit v1.9.1