File tree Expand file tree Collapse file tree
dashboard/src/components/shared Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -205,8 +205,9 @@ const isSingleItemMode = computed(() => (props.modelValue?.length ?? 0) <= 1 &&
205205const singleItemValue = computed ({
206206 get : () => props .modelValue ? .[0 ] ?? ' ' ,
207207 set: (value ) => {
208- // 如果值为空或只有空白字符,emit 空数组
209- if (value .trim () === ' ' ) {
208+ // 仅当值为完全空字符串(未输入任何字符)时清空数组,
209+ // 允许包含空格(如 "hello world")以及纯空格(如 " ")通过
210+ if (value === ' ' ) {
210211 emit (' update:modelValue' , [])
211212 return
212213 }
@@ -241,7 +242,7 @@ const batchImportPreviewCount = computed(() => {
241242watch (() => props .modelValue , (newValue ) => {
242243 localItems .value = [... (newValue || [])]
243244
244- // 自动清理只包含空字符串的数组
245+ // 自动清理只包含空字符串或纯空格的条目(纯空格在配置中无意义,此过滤为预期兜底行为)
245246 if (newValue && newValue .length > 0 ) {
246247 const filtered = newValue .filter (item => typeof item === ' string' ? item .trim () !== ' ' : true )
247248 if (filtered .length !== newValue .length ) {
You can’t perform that action at this time.
0 commit comments