@whitesev/utils 2.5.4 → 2.5.5

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.
@@ -121,20 +121,32 @@ export declare interface Vue2Instance {
121
121
  back: () => void;
122
122
  go: (...args: any[]) => void;
123
123
  replace: (...args: any[]) => void;
124
+ /** 添加路由 */
124
125
  addRoute: (...args: any[]) => void;
125
126
  addRoutes: (...args: any[]) => void;
126
127
  [key: string]: any;
127
128
  };
128
129
  $ssrContext: any;
129
-
130
+ /** 观察者 @returns 取消观察者 */
130
131
  $watch: (
132
+ /** 需要观察的属性 */
131
133
  key: string | string[] | (() => any),
132
- handler: (this: any, newVal: any, oldVal: any) => void,
134
+ /** 属性改变时触发的回调 */
135
+ handler: (
136
+ this: Vue2Instance,
137
+ /** 新值,也就是改变后的值 */
138
+ newVal: any,
139
+ /** 旧值,也就是改变前的值 */
140
+ oldVal: any
141
+ ) => void,
142
+ /** 监听配置 */
133
143
  options?: {
144
+ /** 是否立即执行handler */
134
145
  immediate?: boolean;
146
+ /** 是否深度监听 */
135
147
  deep?: boolean;
136
148
  }
137
- ) => void;
149
+ ) => Function;
138
150
 
139
151
  [key: string]: any;
140
152
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/utils",
3
- "version": "2.5.4",
3
+ "version": "2.5.5",
4
4
  "description": "一个常用的工具库",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -121,20 +121,32 @@ export declare interface Vue2Instance {
121
121
  back: () => void;
122
122
  go: (...args: any[]) => void;
123
123
  replace: (...args: any[]) => void;
124
+ /** 添加路由 */
124
125
  addRoute: (...args: any[]) => void;
125
126
  addRoutes: (...args: any[]) => void;
126
127
  [key: string]: any;
127
128
  };
128
129
  $ssrContext: any;
129
-
130
+ /** 观察者 @returns 取消观察者 */
130
131
  $watch: (
132
+ /** 需要观察的属性 */
131
133
  key: string | string[] | (() => any),
132
- handler: (this: any, newVal: any, oldVal: any) => void,
134
+ /** 属性改变时触发的回调 */
135
+ handler: (
136
+ this: Vue2Instance,
137
+ /** 新值,也就是改变后的值 */
138
+ newVal: any,
139
+ /** 旧值,也就是改变前的值 */
140
+ oldVal: any
141
+ ) => void,
142
+ /** 监听配置 */
133
143
  options?: {
144
+ /** 是否立即执行handler */
134
145
  immediate?: boolean;
146
+ /** 是否深度监听 */
135
147
  deep?: boolean;
136
148
  }
137
- ) => void;
149
+ ) => Function;
138
150
 
139
151
  [key: string]: any;
140
152
  }