File tree 3 files changed +14
-2
lines changed
3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-facing-decorator" ,
3
- "version" : " 1.0.1 " ,
3
+ "version" : " 1.0.2 " ,
4
4
"description" : " Vue typescript class and decorator based component." ,
5
5
"main" : " dist/index.js" ,
6
6
"keywords" : [
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import {
17
17
Inject ,
18
18
Base ,
19
19
} from " vue-facing-decorator" ;
20
-
20
+ import AnotherComponent from " ./AnotherComponent.vue " ;
21
21
// super class, DO NOT SUPPORT ANY DECORATOR now
22
22
class Sup extends Base {
23
23
// reactivity super property
@@ -40,6 +40,10 @@ class Sup extends Base {
40
40
provide: {
41
41
provideKey: " provideValue" ,
42
42
},
43
+ // OPTION, components
44
+ components: {
45
+ AnotherComponent ,
46
+ },
43
47
// OPTION, use modifier to modify component option built by vue-facing-decorator
44
48
modifier : (option : any ) => {
45
49
console .log (" generated optoin" , option );
@@ -127,8 +131,12 @@ is equal to
127
131
128
132
``` typescript
129
133
import { defineComponent } from " vue" ;
134
+ import AnotherComponent from " ./AnotherComponent.vue" ;
130
135
export default defineComponent ({
131
136
name: " MyComponent" ,
137
+ components:{
138
+ AnotherComponent
139
+ },
132
140
emits: [" update:modelValue" ],
133
141
provide: {
134
142
provideKey: " provideValue" ,
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ export function Component(arg: Cons | {
47
47
name ?: string
48
48
emits ?: string [ ]
49
49
provide ?: Record < string , any > | Function
50
+ components ?:Record < string , any >
50
51
modifier ?: ( raw : any ) => any
51
52
} ) : any {
52
53
if ( typeof arg === 'function' ) {
@@ -60,6 +61,9 @@ export function Component(arg: Cons | {
60
61
if ( Array . isArray ( arg . emits ) ) {
61
62
option . emits = arg . emits
62
63
}
64
+ if ( arg . components ) {
65
+ option . components = arg . components
66
+ }
63
67
if ( arg . provide ) {
64
68
option . provide = arg . provide
65
69
}
You can’t perform that action at this time.
0 commit comments