From d50d1edf531371c7b4236dda2d728c2d86fcc9e1 Mon Sep 17 00:00:00 2001 From: Viktor Zdorovtsev Date: Tue, 28 May 2024 15:23:37 +0700 Subject: [PATCH] fix: used methods after destroy --- packages/vue-air-datepicker/src/use-datepicker.ts | 3 +++ pnpm-lock.yaml | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/vue-air-datepicker/src/use-datepicker.ts b/packages/vue-air-datepicker/src/use-datepicker.ts index 2c36d87..f39d1e2 100644 --- a/packages/vue-air-datepicker/src/use-datepicker.ts +++ b/packages/vue-air-datepicker/src/use-datepicker.ts @@ -12,6 +12,9 @@ export function useDatepicker( let datepicker: AirDatepicker | undefined function init() { + if (datepicker?.isDestroyed) + return + const target = (typeof el === 'string' ? el : unrefElement(el)) if (!target || datepicker !== undefined) return diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d2f40fd..4e1da9e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,8 +51,8 @@ importers: specifier: ^10.9.0 version: 10.9.0(vue@3.4.26) air-datepicker: - specifier: ^3.5.0 - version: 3.5.0 + specifier: 3.5.3 + version: 3.5.3 devDependencies: typescript: specifier: ^5.4.5 @@ -1777,8 +1777,8 @@ packages: hasBin: true dev: true - /air-datepicker@3.5.0: - resolution: {integrity: sha512-WOpn1MaSl5drcXSwkXg5Gh/jXX/VFfamNnIb8E43AY4UKuW/bNEW06e3GGsiWLDBQLabD22L6b6cP7KHnAy54w==} + /air-datepicker@3.5.3: + resolution: {integrity: sha512-Elf9gLhv/jidN1+TfeRJYMQRUfYx5apXw2dY5DuAMPRnNtQ4Iw9fTTJK772osmXSUB9xQ2Y8Q1Pt6pgBOQLPQw==} dev: false /ajv@6.12.6: