@varlet/use 3.0.7 → 3.1.0-alpha.1709537939980

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs CHANGED
@@ -164,10 +164,15 @@ function useClickOutside(target, type, listener) {
164
164
  // src/onSmartUnmounted.ts
165
165
  var import_vue4 = require("vue");
166
166
  function onSmartUnmounted(hook) {
167
- (0, import_vue4.onUnmounted)(() => {
167
+ let keepalive = false;
168
+ (0, import_vue4.onDeactivated)(() => {
169
+ keepalive = true;
168
170
  hook();
169
171
  });
170
- (0, import_vue4.onDeactivated)(() => {
172
+ (0, import_vue4.onUnmounted)(() => {
173
+ if (keepalive) {
174
+ return;
175
+ }
171
176
  hook();
172
177
  });
173
178
  }
package/lib/index.js CHANGED
@@ -129,10 +129,15 @@ function useClickOutside(target, type, listener) {
129
129
  // src/onSmartUnmounted.ts
130
130
  import { onDeactivated as onDeactivated2, onUnmounted } from "vue";
131
131
  function onSmartUnmounted(hook) {
132
- onUnmounted(() => {
132
+ let keepalive = false;
133
+ onDeactivated2(() => {
134
+ keepalive = true;
133
135
  hook();
134
136
  });
135
- onDeactivated2(() => {
137
+ onUnmounted(() => {
138
+ if (keepalive) {
139
+ return;
140
+ }
136
141
  hook();
137
142
  });
138
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/use",
3
- "version": "3.0.7",
3
+ "version": "3.1.0-alpha.1709537939980",
4
4
  "type": "module",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.js",
@@ -33,7 +33,7 @@
33
33
  "url": "https://github.com/varletjs/varlet/issues"
34
34
  },
35
35
  "dependencies": {
36
- "@varlet/shared": "3.0.7"
36
+ "@varlet/shared": "3.1.0-alpha.1709537939980"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^18.7.18",