yintai-company-home/src/index.tsx

30 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { px2remTransformer, StyleProvider } from '@ant-design/cssinjs';
const dpr = window.devicePixelRatio || 1;
// 用 UI 缩放因子抵消 Windows 显示缩放导致的“物理尺寸变大”。
// 例如dpr=1.25 时 uiScale=0.8rem 会整体变小 20%。
const uiScale = 1 / dpr;
document.documentElement.style.setProperty('--ui-scale', String(uiScale));
// antd cssinjs 内部 px->rem 转换的 rootValuerootValue 越大rem 越小。
const rootValue = 16 * dpr;
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(
<StyleProvider >
<App />
</StyleProvider>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();