File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,15 @@ export const transformAST: ASTTransformation = (context) => {
16
16
} ,
17
17
} )
18
18
19
- if ( renderFns . length ) {
19
+ const renderMethods = root . find ( j . ObjectMethod , {
20
+ key : {
21
+ name : 'render' ,
22
+ } ,
23
+ params : ( params : Array < any > ) =>
24
+ j . Identifier . check ( params [ 0 ] ) && params [ 0 ] . name === 'h' ,
25
+ } )
26
+
27
+ if ( renderFns . length || renderMethods . length ) {
20
28
addImport ( context , {
21
29
specifier : { type : 'named' , imported : 'h' } ,
22
30
source : 'vue' ,
@@ -25,9 +33,11 @@ export const transformAST: ASTTransformation = (context) => {
25
33
renderFns . forEach ( ( { node } ) => {
26
34
; ( node . value as ArrowFunctionExpression ) . params . shift ( )
27
35
} )
28
- }
29
36
30
- // TODO: render methods
37
+ renderMethods . forEach ( ( { node } ) => {
38
+ node . params . shift ( )
39
+ } )
40
+ }
31
41
}
32
42
33
43
export default wrap ( transformAST )
You can’t perform that action at this time.
0 commit comments