From ec85f7acb65a2ba23b8ce792d470d3f623b5e368 Mon Sep 17 00:00:00 2001 From: Stanislav Popov Date: Sat, 14 May 2022 23:23:38 +0500 Subject: [PATCH] fix: working relative url for images --- pages/index.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pages/index.vue b/pages/index.vue index 1a1100e..447e352 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -829,6 +829,12 @@ export default { // show images as images if (typeof valueText === 'string' && (field.type === 'image' || valueText.match(/^http.*\.(jpg|jpeg|png|gif)$/)) && valueText) { + // relative urls + if (valueText.startsWith('/') && row.url) { + const url = new URL(row.url); + valueText = `${url.origin}/${valueText}`; + } + valueText = `error loading image`; }