diff --git a/dist/js/vue-splide.cjs.js b/dist/js/vue-splide.cjs.js index 78ca348..4dbd7cb 100644 --- a/dist/js/vue-splide.cjs.js +++ b/dist/js/vue-splide.cjs.js @@ -2689,8 +2689,10 @@ const _sfc_main$1 = vue.defineComponent({ } }); vue.onBeforeUnmount(() => { - var _a; - (_a = splide.value) == null ? void 0 : _a.destroy(); + setTimeout(() => { + var _a; + (_a = splide.value) == null ? void 0 : _a.destroy(); + }, props.options.destroyDelay || 0); }); vue.watch(() => merge({}, props.options), (options) => { if (splide.value) { diff --git a/dist/js/vue-splide.esm.js b/dist/js/vue-splide.esm.js index 72c24de..42ca56f 100644 --- a/dist/js/vue-splide.esm.js +++ b/dist/js/vue-splide.esm.js @@ -2687,8 +2687,10 @@ const _sfc_main$1 = defineComponent({ } }); onBeforeUnmount(() => { - var _a; - (_a = splide.value) == null ? void 0 : _a.destroy(); + setTimeout(() => { + var _a; + (_a = splide.value) == null ? void 0 : _a.destroy(); + }, props.options.destroyDelay || 0); }); watch(() => merge({}, props.options), (options) => { if (splide.value) { diff --git a/src/js/components/Splide/Splide.vue b/src/js/components/Splide/Splide.vue index adf982b..ae72004 100644 --- a/src/js/components/Splide/Splide.vue +++ b/src/js/components/Splide/Splide.vue @@ -76,7 +76,9 @@ export default defineComponent( { } ); onBeforeUnmount( () => { - splide.value?.destroy(); + setTimeout(() => { + splide.value?.destroy(); + }, props.options.destroyDelay || 0); } ); watch( () => merge( {}, props.options ), options => {