diff --git a/src/packages/__VUE/empty/empty.taro.vue b/src/packages/__VUE/empty/empty.taro.vue index f2e7c3d9a9..c2c12a0a38 100644 --- a/src/packages/__VUE/empty/empty.taro.vue +++ b/src/packages/__VUE/empty/empty.taro.vue @@ -58,15 +58,7 @@ const style = computed(() => { return {} }) -const src = computed(() => { - if (props.image.startsWith('https://') || props.image.startsWith('http://') || props.image.startsWith('//')) { - return props.image - } else { - return defaultStatus[props.image] - } -}) +const src = computed(() => /^https?:\/\/|^\/\//.test(props.image) ? props.image : defaultStatus[props.image]) -const descriptionText = computed(() => { - return props.description || translate('noData') -}) +const descriptionText = computed(() => props.description || translate('noData')) diff --git a/src/packages/__VUE/empty/empty.vue b/src/packages/__VUE/empty/empty.vue index f2e7c3d9a9..c2c12a0a38 100644 --- a/src/packages/__VUE/empty/empty.vue +++ b/src/packages/__VUE/empty/empty.vue @@ -58,15 +58,7 @@ const style = computed(() => { return {} }) -const src = computed(() => { - if (props.image.startsWith('https://') || props.image.startsWith('http://') || props.image.startsWith('//')) { - return props.image - } else { - return defaultStatus[props.image] - } -}) +const src = computed(() => /^https?:\/\/|^\/\//.test(props.image) ? props.image : defaultStatus[props.image]) -const descriptionText = computed(() => { - return props.description || translate('noData') -}) +const descriptionText = computed(() => props.description || translate('noData'))