Jonathan Kelley 3 лет назад
Родитель
Сommit
dbb6e9b4fe
1 измененных файлов с 4 добавлено и 13 удалено
  1. 4 13
      packages/ssr/src/lib.rs

+ 4 - 13
packages/ssr/src/lib.rs

@@ -159,7 +159,8 @@ impl<'a> TextRenderer<'a, '_> {
                 write!(f, "{}", text.text)?
             }
             VNode::Placeholder(_anchor) => {
-                //
+                *last_node_was_text = false;
+
                 if self.cfg.indent {
                     for _ in 0..il {
                         write!(f, "    ")?;
@@ -168,6 +169,8 @@ impl<'a> TextRenderer<'a, '_> {
                 write!(f, "<!-- -->")?;
             }
             VNode::Element(el) => {
+                *last_node_was_text = false;
+
                 if self.cfg.indent {
                     for _ in 0..il {
                         write!(f, "    ")?;
@@ -205,18 +208,6 @@ impl<'a> TextRenderer<'a, '_> {
                     }
                 }
 
-                // // we write the element's id as a data attribute
-                // //
-                // // when the page is loaded, the `querySelectorAll` will be used to collect all the nodes, and then add
-                // // them interpreter's stack
-                // if let (true, Some(id)) = (self.cfg.pre_render, node.try_mounted_id()) {
-                //     write!(f, " dioxus-id=\"{}\"", id)?;
-
-                //     for _listener in el.listeners {
-                //         // todo: write the listeners
-                //     }
-                // }
-
                 match self.cfg.newline {
                     true => writeln!(f, ">")?,
                     false => write!(f, ">")?,