mirror of
https://github.com/Leado123/Leado123.github.io.git
synced 2026-10-01 00:32:59 +00:00
use hash
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ interface PreviewButtonProps {
|
|||||||
const PreviewButton = ({ fileName }: PreviewButtonProps) => {
|
const PreviewButton = ({ fileName }: PreviewButtonProps) => {
|
||||||
|
|
||||||
const handlePreview = () => {
|
const handlePreview = () => {
|
||||||
const url = `/view/${encodeURIComponent(fileName)}`;
|
const url = `/#/view/${encodeURIComponent(fileName)}`;
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
import { createRoot } from 'react-dom/client'
|
import { createRoot } from 'react-dom/client'
|
||||||
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
|
import { Route, Routes, HashRouter } from 'react-router-dom';
|
||||||
import './index.css'
|
import './index.css'
|
||||||
import App from './App.tsx'
|
import App from './App.tsx'
|
||||||
import View from './View.tsx'
|
import View from './View.tsx'
|
||||||
@@ -11,12 +11,12 @@ import Admin from './Admin.tsx'
|
|||||||
createRoot(document.getElementById('root')!).render(
|
createRoot(document.getElementById('root')!).render(
|
||||||
|
|
||||||
|
|
||||||
<Router>
|
<HashRouter>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/" element={<App />} />
|
<Route path="/" element={<App />} />
|
||||||
<Route path="/view/:file" element={<View />} />
|
<Route path="/view/:file" element={<View />} />
|
||||||
<Route path="/admin" element={<Admin />} />
|
<Route path="/admin" element={<Admin />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
</Router>
|
</HashRouter>
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user