@@ -41,7 +41,11 @@ function use(vm: VueInstance, _This: any) {
4141 use = vm [ SETUP_USE ] ;
4242 } else {
4343 use = new Map ( ) ;
44- vm [ SETUP_USE ] = use ;
44+ Object . defineProperty ( vm , SETUP_USE , {
45+ get ( ) {
46+ return use ;
47+ } ,
48+ } ) ;
4549 }
4650 let app = use . get ( _This ) ! ;
4751 if ( app ) {
@@ -54,13 +58,20 @@ function use(vm: VueInstance, _This: any) {
5458}
5559
5660function proxyVue3Props ( app : InstanceType < DefineConstructor > , vm : VueInstance ) {
57- const render = vm . $options ?. render as Function | undefined ;
61+ interface Item {
62+ ssrRender ?: Function ;
63+ render ?: Function ;
64+ }
65+ if ( ! vm . $ ) {
66+ return ;
67+ }
68+ const item = vm . $ as Item ;
69+ const render = item . ssrRender || item . render ;
5870 if ( app [ SETUP_SETUP_DEFINE ] && render ) {
5971 const keys = Object . keys ( app . $defaultProps ) ;
6072 if ( ! keys . length ) return ;
6173 const proxyRender = ( ...args : any [ ] ) => {
6274 const props = vm . $props ;
63- const defaultProps = app . $defaultProps ;
6475 const arr : { key : string ; pd : PropertyDescriptor } [ ] = [ ] ;
6576 const dpp = createDefineProperty ( props ) ;
6677 // Set default Props
@@ -83,10 +94,11 @@ function proxyVue3Props(app: InstanceType<DefineConstructor>, vm: VueInstance) {
8394 // Resume default props
8495 return res ;
8596 } ;
86- vm . $options . render = proxyRender ;
8797
88- if ( vm . $ ) {
89- ( vm as any ) . $ . render = proxyRender ;
98+ if ( item . ssrRender ) {
99+ item . ssrRender = proxyRender ;
100+ } else if ( item . render ) {
101+ item . render = proxyRender ;
90102 }
91103 }
92104}
0 commit comments