@msom/vue-query-preserve-v3 1.0.0 → 1.0.2

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.
@@ -0,0 +1,21 @@
1
+ import { Plugin } from 'vue';
2
+ export interface QueryPreserveOptions {
3
+ /**
4
+ * 需要保留的查询参数键名白名单
5
+ */
6
+ preserveKeys?: string[];
7
+ /**
8
+ * 跳转前的自定义钩子函数
9
+ * @param to 目标路由对象
10
+ * @param from 来源路由对象
11
+ * @returns 返回 false 可阻止跳转
12
+ */
13
+ beforeNavigate?: (to: any, from: any) => boolean | void;
14
+ }
15
+ /**
16
+ * Vue 3 版本的路由查询参数保留插件
17
+ * @param options 插件配置选项
18
+ */
19
+ declare function createQueryPreservePlugin(options?: QueryPreserveOptions): Plugin;
20
+ export default createQueryPreservePlugin;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,EAAO,MAAM,KAAK,CAAC;AAGvC,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,OAAO,GAAG,IAAI,CAAC;CACzD;AAED;;;GAGG;AACH,iBAAS,yBAAyB,CAAC,OAAO,GAAE,oBAAyB,GAAG,MAAM,CAmD7E;AAED,eAAe,yBAAyB,CAAC"}
package/package.json CHANGED
@@ -1,17 +1,11 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@msom/vue-query-preserve-v3",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
5
  "description": "Vue 3 插件,在路由跳转时自动保留指定的查询参数",
6
- "main": "./dist/index.cjs.js",
7
- "module": "./dist/index.mjs",
8
- "types": "./dist/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "import": "./dist/index.mjs",
12
- "require": "./dist/index.cjs.js"
13
- }
14
- },
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/types/index.d.ts",
15
9
  "files": [
16
10
  "dist"
17
11
  ],
@@ -40,7 +34,9 @@
40
34
  "registry": "https://registry.npmjs.org"
41
35
  },
42
36
  "scripts": {
43
- "build": "tsc --noEmit && vite build --config ../../vite.config.ts",
44
- "release": "pnpm run build && pnpm publish --git-checks=false"
37
+ "clean": "rimraf dist",
38
+ "check": "tsc --noEmit",
39
+ "build": "pnpm run clean && pnpm run check && vite build --config ../../vite.config.ts",
40
+ "release": "pnpm run build && pnpm publish"
45
41
  }
46
42
  }