File tree 2 files changed +4
-20
lines changed 2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -58,15 +58,7 @@ const style = computed(() => {
58
58
return {}
59
59
})
60
60
61
- const src = computed (() => {
62
- if (props .image .startsWith (' https://' ) || props .image .startsWith (' http://' ) || props .image .startsWith (' //' )) {
63
- return props .image
64
- } else {
65
- return defaultStatus [props .image ]
66
- }
67
- })
61
+ const src = computed (() => / ^ https? :\/\/ | ^ \/\/ / .test (props .image ) ? props .image : defaultStatus [props .image ])
68
62
69
- const descriptionText = computed (() => {
70
- return props .description || translate (' noData' )
71
- })
63
+ const descriptionText = computed (() => props .description || translate (' noData' ))
72
64
</script >
Original file line number Diff line number Diff line change @@ -58,15 +58,7 @@ const style = computed(() => {
58
58
return {}
59
59
})
60
60
61
- const src = computed (() => {
62
- if (props .image .startsWith (' https://' ) || props .image .startsWith (' http://' ) || props .image .startsWith (' //' )) {
63
- return props .image
64
- } else {
65
- return defaultStatus [props .image ]
66
- }
67
- })
61
+ const src = computed (() => / ^ https? :\/\/ | ^ \/\/ / .test (props .image ) ? props .image : defaultStatus [props .image ])
68
62
69
- const descriptionText = computed (() => {
70
- return props .description || translate (' noData' )
71
- })
63
+ const descriptionText = computed (() => props .description || translate (' noData' ))
72
64
</script >
You can’t perform that action at this time.
0 commit comments