From b69eeba74bef6c6ae3d72e0f4ca2d3ac670b82e8 Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Wed, 12 Aug 2026 15:41:06 +0800
Subject: [PATCH 1/2] =?UTF-8?q?fix(ns-form):=20=E9=80=82=E9=85=8D=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=92=8CH5=E7=9A=84textare?=
=?UTF-8?q?a=E6=B8=B2=E6=9F=93=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
重构了多平台textarea的渲染条件,合并了平台判断逻辑,新增rows属性配置,优化了样式适配和代码可读性
---
components/ns-form/ns-form.vue | 33 ++++++++++++---------------------
1 file changed, 12 insertions(+), 21 deletions(-)
diff --git a/components/ns-form/ns-form.vue b/components/ns-form/ns-form.vue
index b7f187b..e2b3480 100644
--- a/components/ns-form/ns-form.vue
+++ b/components/ns-form/ns-form.vue
@@ -36,27 +36,18 @@
:style="inputStyle"
>
-
-
-
-
-
-
-
-
+
+
+
From a81386d336ab0dd86039455bc66742d247ab40d8 Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Wed, 12 Aug 2026 15:47:11 +0800
Subject: [PATCH 2/2] =?UTF-8?q?refactor(components):=20=E7=BB=9F=E4=B8=80?=
=?UTF-8?q?=E5=A4=9A=E7=AB=AFtextarea=E9=85=8D=E7=BD=AE=E4=B8=8E=E9=AB=98?=
=?UTF-8?q?=E5=BA=A6=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
1. 对齐ns-form和ns-newform的textarea配置参数,新增textareaRows和textareaLineHeight配置
2. 移除平台分支判断,所有平台统一使用:rows+行高计算高度的方案
3. 适配鸿蒙ArkUI原生TextArea,通过:rows控制行数,JS动态计算高度
4. 移除textarea硬编码高度,改为通过formConfig动态控制
---
components-diy/diy-form.vue | 4 ++
components/ns-form/ns-form.vue | 81 +++++++++++++++++-----------
components/ns-newform/ns-newform.vue | 54 ++++++++++++++++---
3 files changed, 101 insertions(+), 38 deletions(-)
diff --git a/components-diy/diy-form.vue b/components-diy/diy-form.vue
index 14c2300..480937d 100644
--- a/components-diy/diy-form.vue
+++ b/components-diy/diy-form.vue
@@ -209,6 +209,10 @@ export default {
// 占位符:遗漏会被 ns-newform SCSS 默认值回退覆盖
placeholderColor: pick('placeholderColor', 'placeholder_color'),
placeholderFontSize: pick('placeholderFontSize', 'placeholder_font_size'),
+ // textarea 显示行数 / 行高(透传给 ns-newform,与 ns-form 保持一致)
+ // 不传时 ns-newform 走自己的默认 4 行 / 44rpx
+ textareaRows: pick('textareaRows', 'textarea_rows'),
+ textareaLineHeight: pick('textareaLineHeight', 'textarea_line_height'),
// 输入框视觉增强(与 ns-newform 对齐)
inputBorderColor: pick('inputBorderColor', 'input_border_color'),
inputBgColor: pick('inputBgColor', 'input_bg_color'),
diff --git a/components/ns-form/ns-form.vue b/components/ns-form/ns-form.vue
index e2b3480..a3f1cb4 100644
--- a/components/ns-form/ns-form.vue
+++ b/components/ns-form/ns-form.vue
@@ -26,29 +26,17 @@
{{ item.value.required ? '*' : '' }}
-
-
+
-
-
-
-
-
@@ -292,6 +280,11 @@
checkedColor: '#ff4544',
placeholderColor: '#909399',
placeholderFontSize: 28,
+ // textarea 显示行数 / 行高(与 ns-newform 对齐)
+ // 改用 :rows + line-height 驱动高度:rows 给原生