-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,046 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* eslint-disable no-console */ | ||
import React, { useState } from 'react' | ||
import { Calendar, ConfigProvider, DatePicker, Select } from 'antd' | ||
import 'antd/dist/antd.variable.css' | ||
import enUS from 'antd/es/locale/en_US' | ||
import zhCN from 'antd/es/locale/zh_CN' | ||
import 'moment/locale/zh-cn' | ||
|
||
const onChange = (value: any) => { | ||
console.log('🚀 ~ onChange value: ', value) | ||
} | ||
|
||
const App = () => { | ||
const [locale, setLocale] = useState<string>('en_US') | ||
|
||
return <div style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: '12px', | ||
}}> | ||
<ConfigProvider locale={locale === 'zh_CN' ? zhCN : enUS}> | ||
<Select | ||
value={locale} | ||
onChange={setLocale} | ||
options={[ | ||
{ | ||
label: '🇨🇳 中文', | ||
value: 'zh_CN', | ||
}, | ||
{ | ||
label: '🇺🇸 English', | ||
value: 'en_US', | ||
}, | ||
]}> | ||
|
||
</Select> | ||
<DatePicker onChange={onChange} /> | ||
<DatePicker.MonthPicker onChange={onChange} /> | ||
<DatePicker.QuarterPicker onChange={onChange} /> | ||
<DatePicker.RangePicker onChange={onChange} /> | ||
<DatePicker.WeekPicker onChange={onChange} /> | ||
<DatePicker.YearPicker onChange={onChange} /> | ||
<Calendar onChange={onChange} ></Calendar> | ||
</ConfigProvider> | ||
</div> | ||
} | ||
|
||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import App from './App' | ||
|
||
ReactDOM.render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
document.getElementById('root'), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import { defineConfig } from 'vite' | ||
import Inspect from 'vite-plugin-inspect' | ||
import react from '@vitejs/plugin-react' | ||
import Unplugin from '../src/vite' | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
Inspect(), | ||
react(), | ||
Unplugin(), | ||
], | ||
}) |
Oops, something went wrong.