Skip to content

Commit 9edc673

Browse files
committed
a
1 parent c125837 commit 9edc673

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-facing-decorator",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Vue typescript class and decorator based component.",
55
"main": "dist/index.js",
66
"keywords": [

readme.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
Inject,
1818
Base,
1919
} from "vue-facing-decorator";
20-
20+
import AnotherComponent from "./AnotherComponent.vue";
2121
//super class, DO NOT SUPPORT ANY DECORATOR now
2222
class Sup extends Base {
2323
//reactivity super property
@@ -40,6 +40,10 @@ class Sup extends Base {
4040
provide: {
4141
provideKey: "provideValue",
4242
},
43+
//OPTION, components
44+
components: {
45+
AnotherComponent,
46+
},
4347
//OPTION, use modifier to modify component option built by vue-facing-decorator
4448
modifier: (option: any) => {
4549
console.log("generated optoin", option);
@@ -127,8 +131,12 @@ is equal to
127131

128132
```typescript
129133
import { defineComponent} from "vue";
134+
import AnotherComponent from "./AnotherComponent.vue";
130135
export default defineComponent({
131136
name: "MyComponent",
137+
components:{
138+
AnotherComponent
139+
},
132140
emits: ["update:modelValue"],
133141
provide: {
134142
provideKey: "provideValue",

src/component.ts

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export function Component(arg: Cons | {
4747
name?: string
4848
emits?: string[]
4949
provide?: Record<string, any> | Function
50+
components?:Record<string,any>
5051
modifier?: (raw: any) => any
5152
}): any {
5253
if (typeof arg === 'function') {
@@ -60,6 +61,9 @@ export function Component(arg: Cons | {
6061
if (Array.isArray(arg.emits)) {
6162
option.emits = arg.emits
6263
}
64+
if(arg.components){
65+
option.components=arg.components
66+
}
6367
if (arg.provide) {
6468
option.provide = arg.provide
6569
}

0 commit comments

Comments
 (0)