ant-design/components/locale-provider/demo/basic.md

28 lines
489 B
Markdown
Raw Normal View History

2016-03-31 09:40:55 +08:00
---
order: 1
title: 国际化
---
2016-03-03 16:28:02 +08:00
`LocaleProvider` 包裹你的应用,并引用对应的语言包。
````jsx
2016-03-03 17:43:38 +08:00
import { Pagination, LocaleProvider } from 'antd';
2016-03-03 16:28:02 +08:00
import enUS from 'antd/lib/locale-provider/en_US';
const App = React.createClass({
render() {
return (
<div>
<Pagination defaultCurrent={1} total={50} showSizeChanger />
</div>
);
}
});
ReactDOM.render(
<LocaleProvider locale={enUS}>
<App />
</LocaleProvider>
, mountNode);
````