@36node/redux-antd
A higher order component decorator for @36node/redux and antd
Last updated 6 days ago by zzswang .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @36node/redux-antd 
SYNC missed versions from official npm registry.

Redex-Antd

version downloads

HOC for antd to connect @36node/redux

  • table
  • form

Install

yarn install @36node/redux-antd

createForm

It is quite easy to put antd-form into redux, just use createForm, and done.

Read packages/tpl-cra-redux for more detail.

import React, { PureComponent } from "react";
import createForm from "@36node/redux-antd";

@createForm("example")
class ReduxFormExample extends PureComponent {
  render() {
    const { getFieldDecorator } = this.props.form;

    return (
      <Form {...formItemLayout} onSubmit={this.handleSubmit}>
        ... antd form ...
      </Form>
    );
  }
}

createTable

import React from "react";
import { Table } from "antd";
import { makeApiSelector } from "@36node/redux";
import { createTable } from "@36node/redux-antd";

const PETS_KEY = "pets";
const columns = [
  { title: "name", dataIndex: "name", key: "name" },
  { title: "owner", dataIndex: "owner", key: "owner" },
  {
    title: "tag",
    dataIndex: "tag",
    key: "tag",
    filters: [{ text: "CAT", value: "CAT" }, { text: "DOG", value: "DOG" }],
  },
  { title: "age", dataIndex: "age", key: "age", sorter: true },
];

/**
 * actions and selectors
 */
export const listPets = store.makeListPets(PETS_KEY);
export const selectPets = makeApiSelector(PETS_KEY);

/**
 * Pets table
 */
@createTable(PETS_KEY, { apiAction: listPets, apiSelector: selectPets })
export default class extends React.Component {
  render() {
    return <Table columns={columns} {...this.props.table} />;
  }
}

Current Tags

  • 0.2.1                                ...           latest (6 days ago)

25 Versions

  • 0.2.1                                ...           6 days ago
  • 0.2.0                                ...           4 months ago
  • 0.1.21                                ...           8 months ago
  • 0.1.20                                ...           8 months ago
  • 0.1.19                                ...           8 months ago
  • 0.1.18                                ...           9 months ago
  • 0.1.17                                ...           9 months ago
  • 0.1.16                                ...           9 months ago
  • 0.1.15                                ...           9 months ago
  • 0.1.14                                ...           9 months ago
  • 0.1.13                                ...           9 months ago
  • 0.1.12                                ...           9 months ago
  • 0.1.11                                ...           10 months ago
  • 0.1.10                                ...           10 months ago
  • 0.1.9                                ...           10 months ago
  • 0.1.8                                ...           10 months ago
  • 0.1.7                                ...           10 months ago
  • 0.1.6                                ...           10 months ago
  • 0.1.5                                ...           10 months ago
  • 0.1.4                                ...           10 months ago
  • 0.1.2                                ...           10 months ago
  • 0.1.1                                ...           10 months ago
  • 0.1.0                                ...           10 months ago
  • 0.0.2                                ...           10 months ago
  • 0.0.1                                ...           a year ago
Downloads
Today 0
This Week 30
This Month 39
Last Day 0
Last Week 9
Last Month 72
Dependencies (1)
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |