File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-class-store" ,
3
3
"description" : " Universal Vue stores you write once and use anywhere" ,
4
- "version" : " 2.0.3 " ,
4
+ "version" : " 2.0.4 " ,
5
5
"author" : " Dave Stewart" ,
6
6
"license" : " MIT" ,
7
7
"main" : " dist/vue-class-store.js" ,
Original file line number Diff line number Diff line change 1
- import Vue , { ComponentOptions , VueConstructor } from 'vue'
1
+ import Vue , { ComponentOptions } from 'vue'
2
2
3
3
type C = { new ( ...args : any [ ] ) : { } }
4
4
5
5
type R = Record < any , any >
6
6
7
- function getDescriptors ( model : R ) {
7
+ export function makeOptions ( model : R ) : ComponentOptions < any > {
8
+ // prototype
8
9
const prototype = Object . getPrototypeOf ( model )
9
- if ( prototype === null || prototype === Object . prototype ) {
10
+ if ( ! prototype || prototype === Object . prototype ) {
10
11
return { }
11
12
}
12
- const prototypeDescriptors = getDescriptors ( prototype )
13
- const descriptors = Object . getOwnPropertyDescriptors ( prototype )
14
- return { ...prototypeDescriptors , ...descriptors }
15
- }
16
13
17
- export function makeOptions ( model : R ) : ComponentOptions < any > {
18
- // prototype
19
- const prototype = Object . getPrototypeOf ( model )
20
- const descriptors = getDescriptors ( prototype )
14
+ // parent options
15
+ const extendsOptions = makeOptions ( prototype )
16
+
17
+ // descriptors
18
+ const descriptors = Object . getOwnPropertyDescriptors ( prototype )
21
19
22
20
// options
23
21
const name = prototype . constructor . name
@@ -59,6 +57,7 @@ export function makeOptions(model: R): ComponentOptions<any> {
59
57
// return
60
58
return {
61
59
name,
60
+ extends : extendsOptions ,
62
61
computed,
63
62
methods,
64
63
watch,
You can’t perform that action at this time.
0 commit comments