File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
src/components/dataBlockInner Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 11<template >
2- <div v-for =" input in fnType.inputs" class =" input-box" >
2+ <div v-for =" ( input, index) in fnType.inputs" class =" input-box" >
33 <span class =" input-title styled" >{{ t(input.title) }}</span >
44 <s-text-field
5- v-model =" dataItem[input.value]"
5+ v-model.trim =" dataItem[input.value]"
66 :label =" t(input.placeholder)"
77 class =" styled"
8+ ref =" inputBox"
9+ @blur =" handleBlur(index)"
810 >
911 </s-text-field >
1012 </div >
@@ -15,7 +17,19 @@ import { useI18n } from "vue-i18n";
1517const { t } = useI18n ();
1618
1719import { InputProps } from " ../../consts" ;
20+ import { ref } from " vue" ;
1821const { dataItem, fnType } = defineProps <InputProps >();
22+
23+ const inputBox = ref <HTMLElementTagNameMap [" s-text-field" ][]>();
24+
25+ // Chromium 文本框输入三个字形以上的连字时渲染不生效
26+ // 需要在失去焦点时手动添加空格再删除以触发渲染
27+
28+ function handleBlur(index : number ) {
29+ inputBox .value ! [index ].value = inputBox .value ! [index ].value + " " ;
30+ inputBox .value ! [index ].value = inputBox .value ! [index ].value .trim ();
31+ }
32+ const emit = defineEmits ([" blur" ]);
1933 </script >
2034
2135<style >
You can’t perform that action at this time.
0 commit comments