0.0.2 • Published 2 years ago

@clean-js/pro-presenters v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

如何使用

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);
      }}
    />
  );
};
0.0.2

2 years ago

0.0.1

2 years ago