@@ -11,6 +11,7 @@ import { build as optionInject } from './option/inject'
1111import { build as optionEmit } from './option/emit'
1212import { build as optionVModel } from './option/vmodel'
1313import { build as optionAccessor } from './option/accessor'
14+ import { CustomRecords } from './custom/custom'
1415import type { SetupContext } from 'vue' ;
1516import type { OptionBuilder } from './optionBuilder'
1617import type { VueCons } from './index'
@@ -33,6 +34,7 @@ function ComponentOption(cons: Cons, extend?: any) {
3334 optionMethodsAndHooks ( cons , optionBuilder ) //after Ref Computed
3435 optionAccessor ( cons , optionBuilder )
3536
37+
3638 const setupFunction : OptionSetupFunction | undefined = optionBuilder . setup ? function ( props , ctx ) {
3739 return optionBuilder . setup ! ( props , ctx )
3840 } : undefined
@@ -86,13 +88,18 @@ function buildComponent(cons: Cons, arg: ComponentOption, extend?: any): any {
8688 emits = Array . from ( new Set ( [ ...emits , ...arg . emits ] ) )
8789 }
8890 option . emits = emits
89- arg . setup ??= function ( ) { return { } }
9091
91- if ( ! option . setup ) {
9292
93+ CustomRecords . forEach ( rec => {
94+ rec . creator . apply ( { } , [ option , rec . key ] )
95+ } )
96+
97+
98+ arg . setup ??= function ( ) { return { } }
99+ if ( ! option . setup ) {
93100 option . setup = arg . setup
94101 } else {
95-
102+
96103 const oldSetup : OptionSetupFunction = option . setup
97104 const newSetup : ComponentSetupFunction = arg . setup
98105
0 commit comments