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-jexcel

v1.0.3

Published

### 简介

Downloads

4

Readme

React-Jexcel

简介

基于jspreadsheet v4版本,封装的React 版本的轻量级Excel插件,开箱即用,配置简单,极大的方便了React开发着对于excel或者报表的使用需求,本插件将提供完善的demo和中文文档...

文档和demo将不断完善,欢迎大家PR👏

快速开始

安装

yarn add React-Jexcel
// or
npm instll React-Jexcel

在项目中使用

import React, { useRef } from 'react';
import { ReactJexcel } from 'react-jexcel';

export default () => {
  const ref = useRef(null)
  const addRow = () => {
    ref.current.jexcel.insertRow()
  }
  const data = [
    ['Mazda', 2001, 2000],
    ['Pegeout', 2010, 5000],
    ['Honda Fit', 2009, 3000],
    ['Honda CRV', 2010, 6000],
];
  return (
    <>
      <ReactJexcel
        data={data}
        rowResize={true}
        ref={ref}
      />
      <div>
        <button onClick={addRow}>addRow</button>
      </div>
    </>
  )
};

效果截图

属性(Props)

| 属性名 | 含义 | 类型 | | ------------- | -------------- | ------------------------------------------------------------ | | data | 表格数据 | Array,eg:[[1,2,3,4]] | | columns | 列信息 | 见下方列信息 | | rowResize | 是否可调整行高 | boolean | | rows | 初始列信息 | objecteg:{3: {height: '300px'}},代表第3列300px高 | | minDimensions | 表格最小尺寸 | [cols, rows] | | allowExport | 是否允许导出 | boolean,为true时,ctrl + s可导出 | | columnDrag | 是否允许列拖动 | boolean,为true时,可拖动列头交换列顺序 | | 其他属性 | 待完善中文文档 | 可参照原本英文文档属性props |

方法(methods)

本组件支持ref直接调用其方法,全部方法待完善中文文档,如需,可自行到官网查找,直接调用即可

| 方法名 | 作用 | 备注 | | --------- | ------------ | --------------------------------------------------- | | insertRow | 新增一行 | myTable.insertRow([mixed], [integer], [boolean]); | | deleteRow | 删除一行 | myTable.deleteRow([integer], [integer]); | | getData | 获取表格数据 | myTable.getData([bool]); |

贡献者

sorryljt

欢迎大家提PR