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 🙏

© 2025 – Pkg Stats / Ryan Hefner

export-excel-tools

v1.0.0

Published

Vue Excel导出工具组件

Downloads

6

Readme

Vue Excel 导出工具组件

一个简单易用的 Vue Excel 导出工具组件。

安装

npm install export-excel-tools

特性

  • 🚀 数据导出 - 支持导出数据为 Excel 文件
  • 🔄 文件名 - 支持自定义文件名
  • 🎯 样式 - 支持自定义按钮样式
  • 📦 轻量级 - 无依赖,体积小,加载快
  • 📚 文档 - 详细文档和示例
  • 🛠️ 自定义 - 支持自定义按钮样式和文件名

使用方法

全局注册

import Vue from "vue";
import ExportExcelTools from "export-excel-tools";

Vue.use(ExportExcelTools);

局部注册

import { ExcelExporter } from "export-excel-tools";

export default {
  components: {
    ExcelExporter,
  },
};

在模板中使用

<template>
  <excel-exporter
    :data="tableData"
    fileName="我的数据"
    buttonText="导出Excel"
    @export-success="onExportSuccess"
    @export-error="onExportError"
  />
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        { name: "张三", age: 25, city: "北京" },
        { name: "李四", age: 30, city: "上海" },
      ],
    };
  },
  methods: {
    onExportSuccess() {
      console.log("导出成功");
    },
    onExportError(error) {
      console.error("导出失败:", error);
    },
  },
};
</script>

目录结构

export-excel-tools/   # 项目根目录
├── src/   # 组件源码
├── index.js # 入口文件
├── README.md # 描述文件
├── LICENSE # 许可证
├── package.json # 包信息

Props

| 属性名 | 类型 | 必填 | 默认值 | 说明 | | ---------- | ------ | ---- | --------------- | -------------------------- | | data | Array | 是 | - | 要导出的数据数组 | | fileName | String | 否 | 'exported-data' | 导出的文件名(不含扩展名) | | buttonText | String | 否 | '导出 Excel' | 按钮显示的文本 |

事件

| 事件名 | 说明 | 回调参数 | | -------------- | -------------- | --------------- | | export-success | 导出成功时触发 | - | | export-error | 导出失败时触发 | error: 错误信息 |

License

🛠️CDN

<!-- <script src="https://unpkg.com/[email protected]/dist/index.min.js"></script> -->
<script src="https://unpkg.com/[email protected]/dist/index.js"></script>

<!-- 开发环境(未压缩) -->
<!-- <script src="https://unpkg.com/[email protected]/dist/index.js"></script> -->
<script src="https://unpkg.com/[email protected]/dist/index.js"></script>
``` ## 🧪单元测试 项目使用 Jest 进行完整测试,运行以下命令执行测试: ```bash npm
run test

🤝 贡献指南

欢迎对这个项目进行贡献!请遵循以下步骤:

  1. Fork 本仓库。
  2. 创建新分支 (git checkout -b feature/your-feature)。
  3. 提交更改 (git commit -m 'Add some feature')。
  4. 推送分支 (git push origin feature/your-feature)。
  5. 提交 Pull Request。
  • 🎯 欢迎访问我的技术博客:- © https://gitee.com/mahmudtjcu
  • 🎯 欢迎访问我的 Gitee:- © https://www.cnblogs.com/mahmud

📜 许可证

本项目使用 MIT 许可证