mp-weixin-back 0.0.1 → 0.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.
- package/package.json +3 -3
- package/readme.md +19 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mp-weixin-back",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "监听微信小程序的手势返回和页面默认导航栏的返回",
|
|
5
5
|
"main": "./dist/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"author": "",
|
|
28
28
|
"license": "ISC",
|
|
29
|
-
"
|
|
29
|
+
"dependencies": {
|
|
30
30
|
"@babel/generator": "^7.26.2",
|
|
31
31
|
"@babel/parser": "^7.26.2",
|
|
32
32
|
"@babel/traverse": "^7.25.9",
|
|
@@ -46,4 +46,4 @@
|
|
|
46
46
|
"lint-staged": {
|
|
47
47
|
"*": "prettier --write"
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
}
|
package/readme.md
CHANGED
|
@@ -22,6 +22,25 @@ export default defineConfig({
|
|
|
22
22
|
})
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
具体的配置为:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
type Config = {
|
|
29
|
+
/**
|
|
30
|
+
* 是否阻止默认的回退事件,默认为 false
|
|
31
|
+
*/
|
|
32
|
+
preventDefault: boolean
|
|
33
|
+
/**
|
|
34
|
+
* 阻止次数,默认是 `1`
|
|
35
|
+
*/
|
|
36
|
+
frequency: number
|
|
37
|
+
/**
|
|
38
|
+
* 页面回退时触发
|
|
39
|
+
*/
|
|
40
|
+
onPageBack?: (params: BackParams) => void
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
25
44
|
在 vue3 中使用
|
|
26
45
|
|
|
27
46
|
```ts
|