Comparing version 0.4.37 to 0.4.38
/* eslint-disable no-void */ | ||
/* eslint-disable @typescript-eslint/restrict-plus-operands */ | ||
import { mergeProps, computed, defineComponent, ref, onMounted, h, onActivated } from 'vue'; | ||
import { mergeProps, computed, defineComponent, ref, onMounted, h, onActivated, onDeactivated } from 'vue'; | ||
import { depx, pxfy, beforeNextFrameOnce } from 'seemly'; | ||
@@ -88,5 +88,19 @@ import { useMemo } from 'vooks'; | ||
}); | ||
let isDeactivated = false; | ||
let activateStateInitialized = false; | ||
onActivated(() => { | ||
isDeactivated = false; | ||
if (!activateStateInitialized) { | ||
activateStateInitialized = true; | ||
return; | ||
} | ||
// remount | ||
scrollTo({ top: scrollTopRef.value }); | ||
}); | ||
onDeactivated(() => { | ||
isDeactivated = true; | ||
if (!activateStateInitialized) { | ||
activateStateInitialized = true; | ||
} | ||
}); | ||
const keyIndexMapRef = computed(() => { | ||
@@ -197,2 +211,4 @@ const map = new Map(); | ||
var _a, _b, _c, _d; | ||
if (isDeactivated) | ||
return; | ||
if (props.ignoreItemResize) | ||
@@ -234,2 +250,4 @@ return; | ||
function handleListResize(entry) { | ||
if (isDeactivated) | ||
return; | ||
// List is HTMLElement | ||
@@ -236,0 +254,0 @@ if (isHideByVShow(entry.target)) |
@@ -93,5 +93,19 @@ "use strict"; | ||
}); | ||
let isDeactivated = false; | ||
let activateStateInitialized = false; | ||
(0, vue_1.onActivated)(() => { | ||
isDeactivated = false; | ||
if (!activateStateInitialized) { | ||
activateStateInitialized = true; | ||
return; | ||
} | ||
// remount | ||
scrollTo({ top: scrollTopRef.value }); | ||
}); | ||
(0, vue_1.onDeactivated)(() => { | ||
isDeactivated = true; | ||
if (!activateStateInitialized) { | ||
activateStateInitialized = true; | ||
} | ||
}); | ||
const keyIndexMapRef = (0, vue_1.computed)(() => { | ||
@@ -202,2 +216,4 @@ const map = new Map(); | ||
var _a, _b, _c, _d; | ||
if (isDeactivated) | ||
return; | ||
if (props.ignoreItemResize) | ||
@@ -239,2 +255,4 @@ return; | ||
function handleListResize(entry) { | ||
if (isDeactivated) | ||
return; | ||
// List is HTMLElement | ||
@@ -241,0 +259,0 @@ if (isHideByVShow(entry.target)) |
{ | ||
"name": "vueuc", | ||
"version": "0.4.37", | ||
"version": "0.4.38", | ||
"description": "Util Components for Vue", | ||
@@ -40,5 +40,5 @@ "main": "lib/index.js", | ||
"puppeteer": "^13.1.1", | ||
"typescript": "^4.2.2", | ||
"typescript": "~4.6.0", | ||
"vite": "^2.0.1", | ||
"vue": "3.2.33", | ||
"vue": "^3.2.36", | ||
"vue-router": "^4.0.12", | ||
@@ -45,0 +45,0 @@ "@typescript-eslint/parser": "^4.33.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
217940
5653