11import { defineComponent , ComponentCustomOptions } from 'vue' ;
2- import { obtainSlot , getSuperSlot } from './utils'
2+ import { obtainSlot , getSuperSlot , getSlot } from './utils'
33import { build as optionComputed } from './option/computed'
44import { build as optionData } from './option/data'
55import { build as optionMethodsAndLifecycle } from './option/methodsAndLifecycle'
@@ -103,22 +103,35 @@ function build(cons: Cons, option: ComponentOption) {
103103}
104104function _Component ( arg : ComponentConsOption , cb : ( cons : Cons , option : ComponentOption ) => any ) {
105105 if ( typeof arg === 'function' ) {
106+ console . log ( 'zxzxzx A' )
106107 return cb ( arg , { } )
107108 }
109+ console . log ( 'zxzxzx B' )
108110 return function ( cons : Cons ) {
111+ console . log ( 'zxzxzx C' )
109112 return cb ( cons , arg )
110113 }
111114}
112115export function ComponentBase ( arg : ComponentConsOption ) : any {
113116 return _Component ( arg , function ( cons : Cons , option : ComponentOption ) {
117+ console . log ( 'zxzxzx D' )
114118 build ( cons , option )
115119 return cons
116120 } )
117121}
118122
119123export function Component ( arg : ComponentConsOption ) : any {
124+ console . log ( 'zxzxzx' , arg )
120125 return _Component ( arg , function ( cons : Cons , option : ComponentOption ) {
126+ console . log ( 'zxzxzx 2' )
121127 build ( cons , option )
128+ // const slot = getSlot(cons.prototype)!
129+ // Object.defineProperty(cons, '__vccOpts', {
130+ // value: slot.cachedVueComponent
131+ // })
132+ // console.log('kkkk', '__vccOpts' in cons, cons)
133+ // return cons
122134 return obtainSlot ( cons . prototype ) . cachedVueComponent
123135 } )
136+
124137}
0 commit comments