ew/webui/src/main.jsx

27 lines
568 B
React
Raw Normal View History

2024-04-25 00:05:20 +00:00
import React from 'react'
import ReactDOM from 'react-dom/client'
import Login from './login/Login.jsx'
import Home from './home/Home.jsx'
2024-04-25 17:54:20 +00:00
import Import from './import/Import.jsx'
2024-04-25 00:05:20 +00:00
let Elem;
switch (window.location.pathname) {
case "/":
Elem = Login;
break;
case "/home/":
Elem = Home;
break;
2024-04-25 17:54:20 +00:00
case "/import/":
Elem = Import;
break;
2024-04-25 00:05:20 +00:00
default:
window.location.pathname = "/";
}
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<Elem />
</React.StrictMode>,
)