Skip to content

Commit

Permalink
fix(vue): HMR error (#5460)
Browse files Browse the repository at this point in the history
* fix HMR error in vue

this fixes `TypeError: originalSlots[slotName] is not a function` error during HMR in vue by ensuring the function exists.

* Update get-children.js
  • Loading branch information
indus authored Feb 14, 2022
1 parent adc99a5 commit 0374228
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/vue/get-children.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function getChildren(originalSlots = {}, slidesRef, oldSlidesRef) {
};

Object.keys(originalSlots).forEach((slotName) => {
if (typeof originalSlots[slotName] !== 'function') return;
const els = originalSlots[slotName]();
getSlidesFromElements(els, slotName);
});
Expand Down

0 comments on commit 0374228

Please sign in to comment.