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

hf-sheet

v1.0.1

Published

基于luckysheet的Vue3组件

Readme

hf-sheet

基于 Luckysheet 的 Vue3 电子表格组件

安装

npm install hf-sheet

或

pnpm install hf-sheet

使用

方式一:在 HTML 中引入(推荐)

在你的 HTML 文件中引入必要的依赖文件:

<!-- 引入 Luckysheet 样式(从 hf-sheet 包中引入) -->
<link rel="stylesheet" href="/node_modules/hf-sheet/dist/luckysheet/plugins/css/pluginsCss.css" />
<link rel="stylesheet" href="/node_modules/hf-sheet/dist/luckysheet/plugins/plugins.css" />
<link rel="stylesheet" href="/node_modules/hf-sheet/dist/luckysheet/css/luckysheet.css" />
<link rel="stylesheet" href="/node_modules/hf-sheet/dist/luckysheet/assets/iconfont/iconfont.css" />

<!-- 引入 Luckysheet 脚本(从 hf-sheet 包中引入) -->
<script src="/node_modules/hf-sheet/dist/luckysheet/plugins/js/plugin.js"></script>
<script src="/node_modules/hf-sheet/dist/luckysheet/luckysheet.umd.js"></script>
<script src="/node_modules/hf-sheet/dist/luckysheet/luckyexcel.umd.js"></script>

方式二:在 Vite 项目中使用

如果你的项目使用 Vite,可以在 vite.config.js 中配置静态资源别名:

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': '/src',
      'luckysheet': '/node_modules/hf-sheet/dist/luckysheet'
    }
  }
})

然后在你的入口文件(如 main.js 或 App.vue)中引入:

import 'luckysheet/plugins/css/pluginsCss.css'
import 'luckysheet/plugins/plugins.css'
import 'luckysheet/css/luckysheet.css'
import 'luckysheet/assets/iconfont/iconfont.css'

import 'luckysheet/plugins/js/plugin.js'
import 'luckysheet/luckysheet.umd.js'
import 'luckysheet/luckyexcel.umd.js'

全局注册组件

import { createApp } from "vue";
import LuckySheet from "hf-sheet";
import "hf-sheet/dist/hf-sheet.css";

const app = createApp(App);
app.use(LuckySheet);

局部使用组件

<template>
  <LuckySheet
    :dataSourceOptionsFn="getDataSourceOptions"
    @syncUpdate="handleSyncUpdate"
    @back="handleBack"
  />
</template>

<script setup lang="ts">
import { ref } from "vue";
import LuckySheet from "hf-sheet";

const getDataSourceOptions = async () => {
  // 返回数据源选项
  return [
    { label: "数据源1", value: "source1" },
    { label: "数据源2", value: "source2" },
  ];
};

const handleSyncUpdate = (data) => {
  console.log("数据更新:", data);
};

const handleBack = () => {
  console.log("返回");
};
</script>

Props

| 参数 | 说明 | 类型 | 必填 | 默认值 | | ------------------- | -------------------- | -------- | ---- | ------ | | dataSourceOptionsFn | 获取数据源选项的函数 | Function | 是 | - |

Events

| 事件名 | 说明 | 回调参数 | | ---------- | ------------------ | ------------------- | | syncUpdate | 数据同步更新时触发 | (data: any) => void | | back | 返回按钮点击时触发 | () => void |

开发

# 安装依赖
npm install

# 启动开发服务器
npm run dev

# 构建生产版本
npm run build

# 预览构建结果
npm run preview

依赖

  • Vue 3.5+
  • Element Plus 2.13+
  • Luckysheet 2.1.13+
  • jQuery 3.6.0+
  • jQuery Mousewheel 3.1.12+
  • UUID 8.3.2+

License

MIT

Author

alan