npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kn-oa-components/antd3

v0.0.4

Published

> 基于`Antd` 3.x 版本抽出的组件,参数API可参考`Antd` > 部分组件如: `Select` `Form` 做了一些改动,可参考下面例子

Downloads

2

Readme

antd 3.X OA组件库

基于Antd 3.x 版本抽出的组件,参数API可参考Antd 部分组件如: Select Form 做了一些改动,可参考下面例子

Button Select Dialog Form

Button

未做封装,参考Antd

实例

<Button>123</Button>

Select

增加options参数,用于渲染下拉框, 增加valueField参数, 控制value字段 增加labelField参数, 控制label字段 其他参数不受影响

实例

const options = [
  {
    value: 1,
    label: 1,
  },
  {
    value: "lucy",
    label: "lucy",
    children: "自定义一些文案"
  },
  {
    value: "disabled",
    label: "disabled",
    disabled: true
  }
]
<Select
  options={options}
  style={{width: 200}}
  defaultValue={1}
  optionLabelProp="label"
/>

Dialog

提示弹窗依旧使用原组件

<Button onClick={() => {Alert("12333")}}>Alert 默认成功提示</Button>
<Button onClick={() => {ShowErrorAlert("必填")}}>错误提示</Button>

若需要修改配置,参数可以传如对象

<Button onClick={() => {Alert({
    width: 310,
    content: "内容",
    onOk: () => {},
    okText: "已阅读"
  })}}>灵活配置</Button>

一般弹窗也是类似用法,需要说明: 内容组件用content传入,其他参数Antd

<Button onClick={this.onShowModal}>Modal</Button>
function onShowModal() {
  Modal.show({
    title: "标题",
    content: <div>Modal Node</div>,
    onOk: this.onOk
  })
}

Form

为了后续升级方便,封装后的用法,像4.0靠拢

  1. const FormCom = Form.create()(Com)改为const FormCom = Form.useForm(Com);
  2. Form需要传入form={this.props.form}
  3. 支持initialValues参数,同意传入初始值,Form.Item传初始值优先
  4. Form.Item 只需要传name label rules等即可

实例

class Com extends Component {
  <Form form={this.props.form} initialValues={{ name: "张三" }} {...ALL_LINE_LAYOUT} >
    <Form.Item name="name" label="姓名" rules={[{ required: true }]}>
      <Input type="hidden" />
      <span>张三</span>
    </Form.Item>
  </Form>
}

const FormCom = Form.useForm(Com);