From e8e1e91d1c7d5727612a32997a10e8c1b845793e Mon Sep 17 00:00:00 2001 From: James Collins Date: Tue, 2 May 2023 21:05:07 +1000 Subject: [PATCH] update the media value url --- resources/js/components/SMInput.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/js/components/SMInput.vue b/resources/js/components/SMInput.vue index 7c82d35..3a529a4 100644 --- a/resources/js/components/SMInput.vue +++ b/resources/js/components/SMInput.vue @@ -305,6 +305,10 @@ const disabled = ref(props.disabled); watch( () => value.value, (newValue) => { + if (props.type === "media") { + mediaUrl.value = value.value.url ?? ""; + } + active.value = newValue.length > 0 || newValue instanceof File || @@ -357,7 +361,7 @@ if (form) { ); } -const mediaUrl = ref(value.value.url); +const mediaUrl = ref(value.value.url ?? ""); const handleFocus = () => { active.value = true;