fix: 澄清卡片 allow_custom 时允许纯自定义输入提交
- canSubmit 逻辑重构:纯文本卡片只需 customText 非空 - 有选项卡片:满足最小选择数,或(allow_custom 且 customText 非空)即可提交 - 修复其他,请简单描述输入自定义内容后提交按钮灰显的问题 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -63,10 +63,14 @@ const isSingle = computed(() => props.card.card_type === 'single_select')
|
|||||||
const isMulti = computed(() => props.card.card_type === 'multi_select' || props.card.card_type === 'mixed')
|
const isMulti = computed(() => props.card.card_type === 'multi_select' || props.card.card_type === 'mixed')
|
||||||
|
|
||||||
const canSubmit = computed(() => {
|
const canSubmit = computed(() => {
|
||||||
|
// 纯文本输入卡片:只需 customText 非空
|
||||||
|
if (isTextInput.value) return customText.value.trim().length > 0
|
||||||
|
|
||||||
|
// 有选项的卡片:满足最小选择数,或(允许自定义且 customText 非空)
|
||||||
const minSel = props.card.min_selections || 1
|
const minSel = props.card.min_selections || 1
|
||||||
if (selectedValues.value.length < minSel) return false
|
if (selectedValues.value.length >= minSel) return true
|
||||||
if (isTextInput.value && !customText.value.trim()) return false
|
if (props.card.allow_custom && customText.value.trim()) return true
|
||||||
return true
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
function isSelected(value) {
|
function isSelected(value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user