Commit d5122aba25950bde5c09336b9c928874f1b1d02b

Authored by ww
1 parent daa5a5e7

fix: 修复图片组件接受值为空时图片会覆盖图片

... ... @@ -5,6 +5,7 @@
5 5 import { ComponentPropsConfigType } from '../../../index.type';
6 6 import { useDataFetch } from '../../../hook/socket/useSocket';
7 7 import { DataFetchUpdateFn } from '../../../hook/socket/useSocket.type';
  8 + import { isNullOrUnDef } from '/@/utils/is';
8 9
9 10 const props = defineProps<{
10 11 config: ComponentPropsConfigType;
... ... @@ -42,6 +43,7 @@
42 43 const { data = {} } = message;
43 44 const [latest] = data[attribute] || [];
44 45 const [timespan, value] = latest;
  46 + if (isNullOrUnDef(value)) return;
45 47 time.value = timespan;
46 48 url.value = `${value}?timespan=${timespan}`;
47 49 };
... ...