mirror of
https://github.com/yaklang/yaklang-chrome-extension.git
synced 2026-09-22 03:10:43 +08:00
fix
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import './index.css';
|
||||
import App from './App';
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||
root.render(<App/>);
|
||||
@@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import App from './App';
|
||||
|
||||
// 获取根元素
|
||||
const container = document.getElementById('root');
|
||||
if (!container) throw new Error('Failed to find the root element');
|
||||
|
||||
// 创建根
|
||||
const root = createRoot(container);
|
||||
|
||||
// 渲染应用
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
);
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Card, Input, Space, Button, Select, InputNumber, Form, Table } from 'antd';
|
||||
import React, { useRef } from 'react';
|
||||
import { Card, Input, Space, Button, Select, InputNumber, Form, Table, Tooltip, Popover } from 'antd';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import { DeleteOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import { ProxyConfig } from '@/types/proxy';
|
||||
@@ -143,16 +143,16 @@ export const ProxySettings: React.FC<ProxySettingsProps> = ({
|
||||
}
|
||||
];
|
||||
|
||||
const buttonRef = useRef(null);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Space style={{ marginBottom: 16, justifyContent: 'flex-end', width: '100%' }}>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<PlusOutlined />}
|
||||
onClick={onAdd}
|
||||
>
|
||||
添加代理
|
||||
</Button>
|
||||
<Popover content="添加代理" trigger="hover">
|
||||
<Button ref={buttonRef} onClick={onAdd}>
|
||||
添加代理
|
||||
</Button>
|
||||
</Popover>
|
||||
</Space>
|
||||
<Table
|
||||
dataSource={proxyConfigs}
|
||||
|
||||
@@ -2,11 +2,12 @@ import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { App } from 'antd';
|
||||
import { OptionsPage } from './OptionsPage';
|
||||
import zhCN from 'antd/locale/zh_CN';
|
||||
import '@/styles/global.css';
|
||||
|
||||
const container = document.getElementById('root');
|
||||
const root = createRoot(container!);
|
||||
if (!container) throw new Error('Failed to find the root element');
|
||||
|
||||
const root = createRoot(container);
|
||||
|
||||
root.render(
|
||||
<App>
|
||||
|
||||
Reference in New Issue
Block a user