Skip to content

Commit b84d744

Browse files
committed
fix: fix data str or object check
1 parent 10fbddf commit b84d744

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/vue/src/dotlottie.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,13 @@ export const DotLottieVue = defineComponent({
239239
watch(
240240
() => data?.value,
241241
(newVal) => {
242-
if (dotLottie && typeof newVal !== 'object' && typeof newVal !== 'string') {
243-
return;
242+
const isStrOrObject = typeof newVal === 'object' || typeof newVal === 'string';
243+
244+
if (dotLottie && isStrOrObject) {
245+
load({
246+
data: newVal,
247+
});
244248
}
245-
load({
246-
data: newVal,
247-
});
248249
},
249250
{ deep: true },
250251
);

0 commit comments

Comments
 (0)