@clean-js/pro-presenters
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

如何使用

import React from 'react';
import { usePresenter } from '@clean-js/react-presenter';
import { BaseTablePresenter } from './table.presenter';

export const demo = () => {
  const { presenter, state } = usePresenter(BaseTablePresenter);

  useEffect(() => {
    const mockFetchData = async () => ({
      data: [],
      current: 1,
      pageSize: 1,=
      total: 1,
    })
    presenter.setup(mockFetchData);
  }, []);

  return (
    <Table
      loading={state.loading}
      columns={state.columns}
      pagination={state.pagination}
      dataSource={state.data}
      onChange={(p) => {
        presenter.onPageChange?.(p);
      }}
    />
  );
};

Readme

Keywords

none

Package Sidebar

Install

npm i @clean-js/pro-presenters

Weekly Downloads

2

Version

0.0.2

License

MIT

Unpacked Size

24.8 kB

Total Files

8

Last publish

Collaborators

  • lujs