- Format all TypeScript/React code with Prettier - Format all Rust code with cargo fmt - Fix bundle identifier from .app to .desktop to avoid macOS conflicts - Prepare codebase for v3.0.0 Tauri release
25 lines
640 B
TypeScript
25 lines
640 B
TypeScript
import React from "react";
|
||
import ReactDOM from "react-dom/client";
|
||
import App from "./App";
|
||
import "./index.css";
|
||
// 导入 Tauri API(自动绑定到 window.api)
|
||
import "./lib/tauri-api";
|
||
|
||
// 根据平台添加 body class,便于平台特定样式
|
||
try {
|
||
const ua = navigator.userAgent || "";
|
||
const plat = (navigator.platform || "").toLowerCase();
|
||
const isMac = /mac/i.test(ua) || plat.includes("mac");
|
||
if (isMac) {
|
||
document.body.classList.add("is-mac");
|
||
}
|
||
} catch {
|
||
// 忽略平台检测失败
|
||
}
|
||
|
||
ReactDOM.createRoot(document.getElementById("root")!).render(
|
||
<React.StrictMode>
|
||
<App />
|
||
</React.StrictMode>,
|
||
);
|