File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ Welcome to suggest and contribute. Message me on github.
23
23
* [ Basic] ( #basic )
24
24
* [ Extends] ( #extends )
25
25
* [ Tsx render] ( #tsx-render )
26
+ * [ In class lifecycle names] ( # )
26
27
27
28
### Basic
28
29
@@ -70,6 +71,11 @@ class Sup extends Base {
70
71
// OPTION, directives
71
72
directives:{
72
73
74
+ },
75
+ // OPTION, this will be assigned to vue option
76
+ options: {
77
+ beforeRouteEnter() {
78
+ },
73
79
},
74
80
// OPTION, use modifier to modify component option built by vue-facing-decorator
75
81
modifier : (option : any ) => {
@@ -253,6 +259,7 @@ export default defineComponent({
253
259
(this as any ).provideAcientKeyAlias // type error
254
260
);
255
261
},
262
+ beforeRouteEnter() {},
256
263
});
257
264
```
258
265
@@ -412,4 +419,52 @@ export default defineComponent({
412
419
}
413
420
}
414
421
})
422
+ ```
423
+
424
+ ### In class lifecycle names
425
+
426
+ These class names could be defined in class directly.
427
+
428
+ ``` js
429
+ [
430
+ " beforeCreate" ,
431
+ " created" ,
432
+ " beforeMount" ,
433
+ " mounted" ,
434
+ " beforeUpdate" ,
435
+ " updated" ,
436
+ " activated" ,
437
+ " deactivated" ,
438
+ " beforeDestroy" ,
439
+ " beforeUnmount" ,
440
+ " destroyed" ,
441
+ " unmounted" ,
442
+ " renderTracked" ,
443
+ " renderTriggered" ,
444
+ " errorCaptured" ,
445
+ " serverPrefetch"
446
+ ]
447
+ ```
448
+
449
+ For names not in this list, use
450
+
451
+ ``` typescript
452
+ @Component ({
453
+ options:{
454
+ foo(){
455
+
456
+ }
457
+ }
458
+ })
459
+ ```
460
+
461
+ or
462
+
463
+ ``` typescript
464
+ @Component ({
465
+ modifier(opt : any ){
466
+ opt .foo = function (){}
467
+ return opt
468
+ }
469
+ })
415
470
```
You can’t perform that action at this time.
0 commit comments