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.
2323* [ Basic] ( #basic )
2424* [ Extends] ( #extends )
2525* [ Tsx render] ( #tsx-render )
26+ * [ In class lifecycle names] ( # )
2627
2728### Basic
2829
@@ -70,6 +71,11 @@ class Sup extends Base {
7071 // OPTION, directives
7172 directives:{
7273
74+ },
75+ // OPTION, this will be assigned to vue option
76+ options: {
77+ beforeRouteEnter() {
78+ },
7379 },
7480 // OPTION, use modifier to modify component option built by vue-facing-decorator
7581 modifier : (option : any ) => {
@@ -253,6 +259,7 @@ export default defineComponent({
253259 (this as any ).provideAcientKeyAlias // type error
254260 );
255261 },
262+ beforeRouteEnter() {},
256263});
257264```
258265
@@ -412,4 +419,52 @@ export default defineComponent({
412419 }
413420 }
414421})
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+ })
415470```
You can’t perform that action at this time.
0 commit comments