2022-11-08 03:32:28 +00:00
|
|
|
# Settings Center
|
2022-09-30 04:41:23 +00:00
|
|
|
|
2022-10-31 14:41:24 +00:00
|
|
|
<img src="./settings-center/settings-tab.jpg" style="max-width: 100%;"/>
|
2022-09-30 04:41:23 +00:00
|
|
|
|
2022-11-08 03:32:28 +00:00
|
|
|
## Example
|
2022-09-30 04:41:23 +00:00
|
|
|
|
|
|
|
```tsx | pure
|
|
|
|
import { SettingsCenterProvider } from '@nocobase/client';
|
|
|
|
import React, { useContext } from 'react';
|
|
|
|
|
|
|
|
const HelloTab => () => <div>Hello Tab</div>;
|
|
|
|
|
|
|
|
export default React.memo((props) => {
|
|
|
|
return (
|
|
|
|
<SettingsCenterProvider
|
|
|
|
settings={{
|
|
|
|
'sample-hello': {
|
|
|
|
title: 'Hello',
|
|
|
|
icon: 'ApiOutlined',
|
|
|
|
tabs: {
|
|
|
|
tab1: {
|
|
|
|
title: 'Hello Tab',
|
|
|
|
component: HelloTab,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
>{props.children}</SettingsCenterProvider>
|
|
|
|
);
|
|
|
|
});
|
|
|
|
```
|
|
|
|
|
2022-11-08 03:32:28 +00:00
|
|
|
See [samples/hello](https://github.com/nocobase/nocobase/tree/develop/packages/samples/hello) for full examples.
|