@msom/vue-query-preserve-v2 1.0.0 → 1.0.1

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,26 @@
1
+ /**
2
+ * Vue 2 版本插件 - 路由查询参数保留插件
3
+ * 适配 Vue 2.x + vue-router@3
4
+ */
5
+ export interface QueryPreserveOptions {
6
+ /**
7
+ * 需要保留的查询参数键名白名单
8
+ */
9
+ preserveKeys?: string[];
10
+ /**
11
+ * 跳转前的自定义钩子函数
12
+ * @param to 目标路由对象
13
+ * @param from 来源路由对象
14
+ * @returns 返回 false 可阻止跳转
15
+ */
16
+ beforeNavigate?: (to: any, from: any) => boolean | void;
17
+ }
18
+ /**
19
+ * Vue 2 版本的路由查询参数保留插件
20
+ * @param options 插件配置选项
21
+ */
22
+ declare function createQueryPreservePlugin(options?: QueryPreserveOptions): {
23
+ install(Vue: any): void;
24
+ };
25
+ export default createQueryPreservePlugin;
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,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;iBAIpD,GAAG;EAiDnB;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-v2",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "description": "Vue 2 插件,在路由跳转时自动保留指定的查询参数",
6
- "main": "./dist/index.cjs.js",
7
- "module": "./dist/index.mjs",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "import": "./dist/index.mjs",
12
- "require": "./dist/index.cjs.js"
13
- }
14
- },
15
9
  "files": [
16
10
  "dist"
17
11
  ],
@@ -41,7 +35,9 @@
41
35
  "registry": "https://registry.npmjs.org"
42
36
  },
43
37
  "scripts": {
44
- "build": "tsc --noEmit && vite build --config ../../vite.config.ts",
45
- "release": "pnpm run build && pnpm publish --git-checks=false"
38
+ "clean": "rimraf dist",
39
+ "check": "tsc --noEmit",
40
+ "build": "pnpm run clean && pnpm run check && vite build --config ../../vite.config.ts",
41
+ "release": "pnpm run build && pnpm publish"
46
42
  }
47
43
  }