Skip to content

Commit 806545f

Browse files
committed
补充说明
1 parent ddea9e6 commit 806545f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/dataBlockInner/strInputs.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ const { dataItem, fnType } = defineProps<InputProps>();
2323
const inputBox = ref<HTMLElementTagNameMap["s-text-field"][]>();
2424
2525
// Chromium 文本框输入三个字形以上的连字时渲染不生效
26-
// 需要在失去焦点时手动添加空格再删除以触发渲染
26+
// 需要在失去焦点时手动对文本框赋值以触发渲染
27+
// 直接操作 .value 属性不会触发 Vue 的响应式更新,无需担忧性能
2728
2829
function handleBlur(index: number) {
29-
inputBox.value![index].value = inputBox.value![index].value + " ";
30-
inputBox.value![index].value = inputBox.value![index].value.trim();
30+
const element = inputBox.value![index];
31+
const value = element.value;
32+
element.value = value + "\u200B";
33+
element.value = value;
3134
}
3235
const emit = defineEmits(["blur"]);
3336
</script>

0 commit comments

Comments
 (0)