docs(ComponentCard): add ignoreVModel prop

This commit is contained in:
Benjamin Canac
2023-12-07 11:43:55 +01:00
parent 4548809ee5
commit c023fb400c

View File

@@ -110,6 +110,10 @@ const props = defineProps({
componentClass: {
type: String,
default: ''
},
ignoreVModel: {
type: Boolean,
default: false
}
})
@@ -218,6 +222,9 @@ const code = computed(() => {
if (value === 'undefined' || value === null) {
continue
}
if (key === 'modelValue' && props.ignoreVModel) {
continue
}
code += ` ${(typeof value === 'boolean' && (value !== true || key === 'modelValue')) || typeof value === 'object' || typeof value === 'number' ? ':' : ''}${key === 'modelValue' ? 'model-value' : kebabCase(key)}${typeof value === 'boolean' && !!value && key !== 'modelValue' ? '' : `="${typeof value === 'object' ? renderObject(value) : value}"`}`
}