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

react-antd-sku

v1.0.1

Published

sku component for react antd

Downloads

18

Readme

react-antd-sku

在线案例

ss

<Sku
  ref={this.skuRef}
  form={form}
  label1="规格属性"
  label2="价格"
  formItemLayout={{
    labelCol: {
      span: 4
    },
    wrapperCol: {
      span: 20
    }
  }}
  useDefaultButton={false}
  skuPropsList={skuPropsList}
  skuPropVoList={propVoList}
  addTagApi={this.addTagApi}
  filterSku={skuTags => {
    let k = skuTags
      .map(tag => tag.id)
      .sort()
      .join(":");
    let sku = skuData.filter(sku => {
      let k1 = sku.tags.sort().join(":");
      return k === k1;
    });
    return sku[0];
  }}
  extras={[
    {
      title: "建议售价",
      dataIndex: "preprice",
      width: 150,
      render: (v, record, row) => {
        return this.renderBaseFormItem({
          key: `${record.rowKey}.preprice`,
          config: {
            initialValue: v
          },
          el: (
            <Input
              style={{
                padding: 0,
                textAlign: "center"
              }}
              placeholder="请输入原价"
            />
          )
        });
      }
    }
  ]}
  footer={() => (
    <p>
      <span style={{ margin: "0 10px" }}>批量设置:</span>
      <a
        href="void:javascript(0)"
        type="link"
        onClick={() => {
          this.setState(
            {
              dialogTitle: "价格",
              dialogOpt: "price"
            },
            () => {
              this.dialog.current.show();
            }
          );
          return false;
        }}
      >
        价格
      </a>
    </p>
  )}
  onChange={v => {
    this.setState({
      tmpSkuProps: v.tmpSkuProps,
      skuTableColumns: v.skuTableColumns,
      skuTableDataSource: v.skuTableDataSource
    });
  }}
/>

API

| 参数 | 说明 | 类型 | 默认值 | 案例 | | ---------------- | ----------------------------------------------- | ---------------------- | ------ | ------------------------------------------------------------ | | title | 表格头部 , 同antd Table | Function | | ()=>"表头" | | footer | 表格尾部 ,同antd Table | Function | | ()=>Footer | | useDefaultButton | 使用默认的"添加属性" 按钮 | | TRUE | | | extras | 拓展sku 列 | Function=>Array|[] | | | | form | 接管 sku 内 form | | | | | skuPropsList | 属性列表 | Array | | [ { id: 4, propertyName: "规格"}, ] | | skuPropVoList | 显示数据时, 属性及其tag | Array | | [ { id: 4, propertyName: "规格", tagList: [ { id: 1, tagName: "a" } ] } ] | | addTagApi | tag 添加时api | Function=>Promise | | | | filterSku | 显示 sku 表格时,根据 sku 组合 查找指定 sku 数据 | Function=> sku | | | | onChange | sku 更新时事件, 传出表格所有数据 | | | | | 事件 | 说明 | | | | | reset | 重置 sku 设计区 | Function | | | | addOneProp | 添加一个属性选择框 | Function | | | | refreshSKUTable | 刷新 sku 表格 | Function | | | | setCurrentProp | 新增属性时 设置回显到选择框 | Function( propertyId ) | | | | | | | | |