Browse Source

feat:ui test

wanghao 1 month ago
parent
commit
67f8c6b90f
1 changed files with 12 additions and 2 deletions
  1. 12 2
      obui/app/scripts/components/node-details.js

+ 12 - 2
obui/app/scripts/components/node-details.js

@@ -1,5 +1,5 @@
 import debug from 'debug';
-import React from 'react';
+import React,{useEffect} from 'react';
 import classNames from 'classnames';
 import PropTypes from 'prop-types';
 import { connect } from 'react-redux';
@@ -89,9 +89,18 @@ class NodeDetails extends React.Component {
         total:0,
         current:1,
       }
-    }
+    },
+    // ui test
+    useEffect(() => {
+      console.log(123456789,'useEffect')
+      //当url路径在xxx路径下时
+      if (window.location.pathname?.includes('xxx')) {
+        //执行特定操作
+      }
+    }, [window.location.pathname]);
   }
 
+
   handleClickClose = (ev) => {
     ev.preventDefault();
     this.props.clickCloseDetails(this.props.nodeId);
@@ -105,6 +114,7 @@ class NodeDetails extends React.Component {
     // 在这里执行你需要的清理工作
     this.props.clickCloseDetails(this.props.nodeId);
   };
+
   componentDidMount() {
     let _this = this
     // //上线时打开开始