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 🙏

© 2026 – Pkg Stats / Ryan Hefner

hl-table-render

v1.0.3

Published

使用handsontable结合vue3渲染表格,能对单元格进行编辑和各种操作

Readme

表格编辑器

使用方法

<script setup lang="ts">
  import { HlTableRender } from 'hl-table-render';
  import 'hl-table-render/dist/hl-table-render.css';
  import { reactive, ref } from 'vue';

  const hlTableRenderRef = ref();
  const state = reactive({
    mode: 'editable',
    renderData: {
      rows: [
        ['101纳税申报企业类型(填写代码)', '纳税代码', '102分支机构就地纳税比例(%)', '102'],
        ['103资产总额(填写平均值,单位:万元)', 'mima', '104从业人数(填写平均值,单位:人)', ''],
        ['105所属国民经济行业(填写代码)', true, '106从事国家限制或禁止行业', '2025年01月01日'],
        ['107适用会计准则或会计制度(填写代码)', '', '108采用一般企业财务报表格式(2019年)版', ''],
        ['aa', 'bb', 'cc', 'dd'],
        ['ee', 'ff', 'gg', 'hh'],
      ],
      mergeCells: [
        { row: 4, col: 0, rowspan: 2, colspan: 2}
      ],
      cellComments: [
        {
          row: 0,
          col: 2,
          comment: {
            value: '初始化批注'
          }
        },
        {
          row: 2,
          col: 3,
          comment: {
            value: '随便一点批注'
          }
        }
      ],
      readOnlyCells: [
        '0-0',
        '2-0',
        '0-2',
        '2-2',
        '3-2'
      ],
      cellTypeList: [
        {
          row: 0,
          col: 1,
          type: 'text',
        },
        {
          row: 0,
          col: 3,
          type: 'numeric',
        },
        {
          row: 1,
          col: 1,
          type: 'password'
        },
        {
          row: 1,
          col: 3,
          type: 'autocomplete',
          source: ['aa', 'bb', 'cc', 'dd'],
          strict: false
        },
        {
          row: 2,
          col: 1,
          type: 'checkbox',
          label: {
            position: 'after',
            value: '真的吗?'
          }
        },
        {
          row: 2,
          col: 3,
          type: 'date',
          dateFormat: 'YYYY年MM月DD日'
        },
        {
          row: 3,
          col: 1,
          type: 'dropdown',
          source: ['aa', 'bb', 'cc', 'dd'],
        },
      ]
    }
  });
  const clickGetTableConfig = () => {
    console.log(hlTableRenderRef.value.getTableConfig());
  };
</script>

<template>
  <div class="box">
    <n-button @click="clickGetTableConfig">获取表格数据</n-button>
    <HlTableRender ref="hlTableRenderRef" :mode="state.mode" :render-data="state.renderData"  />
  </div>
</template>

<style scoped lang="scss">
  .box {
    margin: 50px auto;
    width: 80%;
  }

</style>

属性说明

interface Props {
  mode: 'editable' | 'write' | 'preview'; // 模式 editable 编辑 write 填写 preview 预览
  readOnlyColor?: string; // 只读状态的颜色,默认#a3a3a3
  renderData: {
    rows: string[][]; // 表格数据
    mergeCells: App.MergeCellsItem[]; // 合并单元格
    cellComments: App.CellCommentItem[]; // 单元格批注
    readOnlyCells: string[]; // 只读单元格索引
    cellTypeList: App.CellTypeItem[]; // 单元格数据类型
  }
}
const props = withDefaults(defineProps<Props>(), {
  readOnlyColor: '#a3a3a3'
});