Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ne-smalltown/doni

基于 Mobx 的高性能 UI 组件库。A high performance UI library using magic Mobx and Antd!
https://github.com/ne-smalltown/doni

ant-design antd component-library library react ui

Last synced: 3 days ago
JSON representation

基于 Mobx 的高性能 UI 组件库。A high performance UI library using magic Mobx and Antd!

Awesome Lists containing this project

README

        

# Doni

A high performance UI library using magic Mobx and Antd!

# What magic it has?

See https://zhuanlan.zhihu.com/p/469224590

# Install

`npm i doni`

# Example

```jsx
import { Table, BodyCell, ModalButton, DoniTableColumn } from 'doni';
import { types } from 'mobx-state-tree';

const ModelArticle = types.model({
id: types.string,
images: types.array(types.string),
});

const columns: DoniTableColumn[] = [
{
title: 'id',
width: '10%',
fixed: 'left',
render: (article) => article.id,
},
{
title: 'images',
width: '15%',
render: ({ images }) => {
return (



)
},
},
{
title: 'Action',
width: '15%',
fixed: 'right',
render: (article, { modals: [ changeTitleModal ], action }) => {
const handleSubmitChangeForm = async (submitData: any) => {
action.setRecord((article: IModelArticle) => {
article.title = submitData.newTitle;
});

await new Promise(r => {
setTimeout(r, 3000);
});

changeTitleModal.closeModal();
};

return (


{ dom }
,
}}
onFinish={ handleSubmitChangeForm }
>
New Title}
placeholder='Please input new title.'
rules={[{ required: true, message: 'Please input new title.' }]}
/>



);
},
},
];

```