2025-08-04 22:16:26 +08:00
|
|
|
|
import React from 'react'
|
|
|
|
|
|
import ReactDOM from 'react-dom/client'
|
|
|
|
|
|
import App from './App'
|
|
|
|
|
|
import './index.css'
|
2025-08-25 10:30:45 +08:00
|
|
|
|
// 导入 Tauri API(自动绑定到 window.api)
|
2025-08-23 20:38:57 +08:00
|
|
|
|
import './lib/tauri-api'
|
2025-08-25 10:33:19 +08:00
|
|
|
|
import { platform as osPlatform } from '@tauri-apps/api/os'
|
2025-08-10 19:13:45 +08:00
|
|
|
|
|
|
|
|
|
|
// 根据平台添加 body class,便于平台特定样式
|
2025-08-25 10:33:19 +08:00
|
|
|
|
osPlatform().then((p) => {
|
|
|
|
|
|
if (p === 'darwin') {
|
|
|
|
|
|
document.body.classList.add('is-mac')
|
|
|
|
|
|
}
|
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
// 忽略平台检测失败
|
|
|
|
|
|
})
|
2025-08-10 19:13:45 +08:00
|
|
|
|
|
2025-08-04 22:16:26 +08:00
|
|
|
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
|
|
|
|
<React.StrictMode>
|
|
|
|
|
|
<App />
|
|
|
|
|
|
</React.StrictMode>
|
2025-08-10 19:13:45 +08:00
|
|
|
|
)
|