Explorar o código

feat:调整ss-input换行及回显问题

apple hai 1 día
pai
achega
7ed601b1b9
Modificáronse 2 ficheiros con 8 adicións e 9 borrados
  1. 4 8
      js/vue/ss-components.js
  2. 4 1
      skin/easy/main.css

+ 4 - 8
js/vue/ss-components.js

@@ -178,11 +178,7 @@ import { EVEN_VAR } from "./EventBus.js";
         type: String,
         default: "",
       },
-      // 新增:是否允许回车换行,默认false禁止换行 by xu 20251212
-      multiline: {
-        type: Boolean,
-        default: false,
-      },
+      // 功能说明:传 height 时允许回车换行(多行输入);未传 height 默认单行 by xu 20260204
     },
     emits: ["update:modelValue", "input", "blur", "change"], // 允许更新 v-model 绑定的值
     setup(props, { emit }) {
@@ -386,10 +382,10 @@ import { EVEN_VAR } from "./EventBus.js";
         // contentFloatingDiv.value = false
       };
 
-      // 处理键盘按下事件,禁止回车换行 by xu 20251212
+      // 功能说明:传了 height 视为多行允许回车;未传 height 拦截回车(单行表现) by xu 20260204
       const onKeydown = (event) => {
-        // 如果不允许多行且按下的是回车键,阻止默认行为
-        if (!props.multiline && event.key === 'Enter') {
+        const allowMultiline = typeof props.height === "string" && props.height.trim() !== "";
+        if (!allowMultiline && event.key === 'Enter') {
           event.preventDefault();
         }
       };

+ 4 - 1
skin/easy/main.css

@@ -135,7 +135,10 @@ input[type='password']::-webkit-input-placeholder {
 }
 
 
-
+#ms{
+    white-space: pre-wrap;
+    word-break: break-word;
+}