浏览代码

chore: use trim

Jonathan Kelley 2 年之前
父节点
当前提交
40a36aa8e6
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1 3
      packages/core/src/virtual_dom.rs

+ 1 - 3
packages/core/src/virtual_dom.rs

@@ -385,9 +385,7 @@ impl VirtualDom {
         };
 
         // Remove the "on" prefix if it exists, TODO, we should remove this and settle on one
-        if name.starts_with("on") {
-            name = &name[2..];
-        }
+        name = name.trim_start_matches("on");
 
         // Loop through each dynamic attribute in this template before moving up to the template's parent.
         while let Some(el_ref) = parent_path {