@@ -48,7 +48,7 @@ export const wchtmlloader = (
48
48
node . __template += `<style> ${ node . __css } </style>` ; delete node . __css ;
49
49
}
50
50
51
- if ( node . __template ) {
51
+ if ( ' __template' in node ) {
52
52
53
53
if ( typeof node . __renderonchanged === 'function' ) {
54
54
let renderonchanged = node . __renderonchanged ;
@@ -78,15 +78,16 @@ export const wchtmlloader = (
78
78
let cpy = Object . assign ( { } , node ) ;
79
79
let keys = Object . getOwnPropertyNames ( cpy ) ;
80
80
for ( const k of keys ) {
81
- if ( ! ( k in cpy ) ) continue ;
82
81
if ( k === 'style' && typeof node [ k ] === 'object' ) { Object . assign ( node . __props . style , cpy [ k ] ) ; }
82
+ else if ( k === 'className' ) node . __props . setAttribute ( 'class' , cpy [ k ] ) ;
83
83
else node . __props [ k ] = cpy [ k ] ;
84
84
}
85
85
86
86
if ( node . __attributes ) {
87
87
for ( const k in node . __attributes ) {
88
88
if ( k === 'style' && typeof node . __attributes [ k ] === 'object' ) { Object . assign ( node . __props . style , node . __attributes [ k ] ) ; }
89
- node . __props [ k ] = node . __attributes [ k ] ;
89
+ else if ( k === 'className' ) node . __props . setAttribute ( 'class' , node . __attributes [ k ] ) ;
90
+ else node . __props [ k ] = node . __attributes [ k ] ;
90
91
}
91
92
}
92
93
node . __proxyObject ( node . __props ) ;
@@ -95,8 +96,8 @@ export const wchtmlloader = (
95
96
let cpy = Object . assign ( { } , node ) ;
96
97
let keys = Object . getOwnPropertyNames ( cpy ) ;
97
98
for ( const k of keys ) {
98
- if ( ! ( k in cpy ) ) continue ;
99
99
if ( k === 'style' && typeof node [ k ] === 'object' ) { Object . assign ( node . __props . style , cpy [ k ] ) ; }
100
+ else if ( k === 'className' ) node . __props . setAttribute ( 'class' , cpy [ k ] ) ;
100
101
else node . __props [ k ] = cpy [ k ] ;
101
102
}
102
103
0 commit comments