Răsfoiți Sursa

class to className

visuddhinanda 2 ani în urmă
părinte
comite
d7806c63bd
1 a modificat fișierele cu 5 adăugiri și 1 ștergeri
  1. 5 1
      dashboard/src/components/template/utilities.ts

+ 5 - 1
dashboard/src/components/template/utilities.ts

@@ -37,7 +37,11 @@ export function XmlToReact(
       if (attr[i].nodeType === 2) {
       if (attr[i].nodeType === 2) {
         let key: string = attr[i].nodeName;
         let key: string = attr[i].nodeName;
         if (key !== "style") {
         if (key !== "style") {
-          output[key] = attr[i].nodeValue;
+          if (key === "class") {
+            output["className"] = attr[i].nodeValue;
+          } else {
+            output[key] = attr[i].nodeValue;
+          }
         } else {
         } else {
           //TODO 把css style 转换为react style
           //TODO 把css style 转换为react style
         }
         }