Tweak equality check of input nullable

This commit is contained in:
rijkvanzanten
2021-01-13 17:31:40 -05:00
parent c7deca0c0e
commit 890d5338f2
2 changed files with 2 additions and 2 deletions

View File

@@ -201,7 +201,7 @@ export default defineComponent({
function emitValue(event: InputEvent) {
let value = (event.target as HTMLInputElement).value;
if (props.nullable === true && value === '') {
if (props.nullable === true && !value) {
emit('input', null);
return;
}

View File

@@ -67,7 +67,7 @@ export default defineComponent({
});
const _template = computed(() => {
return props.template || `{{ ${primaryKeyField.value.field} }}`;
return props.template || `{{ ${primaryKeyField.value!.field} }}`;
});
return { relatedCollection, primaryKeyField, getLinkForItem, _template };