File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1036,7 +1036,11 @@ macro importComponent*(body: untyped): untyped =
1036
1036
# Template
1037
1037
if templateSource.len > 0 :
1038
1038
var
1039
- tagData = initTagVm(" div" , @ [tagFromStringVm(componentData[templateSource[0 ].group(0 )])], true )
1039
+ tagData =
1040
+ when defined(js):
1041
+ initTagVm(" div" , @ [tagFromStringVm(componentData[templateSource[0 ].group(0 )])], true )
1042
+ else :
1043
+ initTag(" div" , @ [tagFromString(componentData[templateSource[0 ].group(0 )])], true )
1040
1044
statements = newStmtList()
1041
1045
1042
1046
proc inCreatedComponents(tag: string ): string =
@@ -1047,6 +1051,11 @@ macro importComponent*(body: untyped): untyped =
1047
1051
return key
1048
1052
" "
1049
1053
1054
+ when defined(js):
1055
+ discard
1056
+ else :
1057
+ type VmTagRef = TagRef
1058
+
1050
1059
proc handle(tag: VmTagRef, parent: var NimNode) =
1051
1060
var ifStartIndex = - 1
1052
1061
for child in tag.children:
Original file line number Diff line number Diff line change @@ -539,6 +539,9 @@ func `$`*(self: TagRef): string =
539
539
540
540
541
541
when defined(js):
542
+ proc `$` * (self: Node): string =
543
+ $ self.outerHTML
544
+
542
545
func add* (self: VmTagRef, tags: varargs [VmTagRef]) =
543
546
# # Adds `other` tag into `self` tag
544
547
runnableExamples:
You can’t perform that action at this time.
0 commit comments