1 Star 0 Fork 1

花丢 / excel_read

forked from Essence / excel_read 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

wasm-pack-template

A template for kick starting a Rust and WebAssembly project using wasm-pack.

Build Status

Tutorial | Chat

Built with 🦀🕸 by The Rust and WebAssembly Working Group

About

📚 Read this template tutorial! 📚

This template is designed for compiling Rust libraries into WebAssembly and publishing the resulting package to NPM.

Be sure to check out other wasm-pack tutorials online for other templates and usages of wasm-pack.

🚴 Usage

🐑 Use cargo generate to Clone this Template

Learn more about cargo generate here.

cargo generate --git https://gitee.com/guoyucode/excel_read.git --name my-project
cd my-project

🛠️ Build with build

wasm-pack build --target web

🔬 Test in Browsers with Use js

1: copy pgk dir files to html dir
2: <input type="file" id="file" multiple="multiple" onchange="read()">

3:
<script>
    function read() {
        var file = document.getElementById('file').files[0]//获取文件流

        /// file: 前端File对象
        /// title_row: 标题在第几行 组合标题: [2,3]; 单行标题: [1]
        /// rows_excluded: 排除多少行数据, 一行, 二行, 三行: [1,2,3];
        /// excluded_keyword: 关键字排除: 在单元格中检测到该关键字读取终止
        read_excel_file(file, [1], [], "合计").then(res => {
            console.log("excel_json:", res);
        }).catch(e => {
            alert(e);
        });
    }
</script>

4:
<script type="module">
    // 初始化wasm里的方法
    import {default as wasm, greet, read_excel_file} from "./excel_read.js";
    wasm().then((module) => {
        window.read_excel_file = read_excel_file;
    });
</script>

🛠️ run html run

cd pkg
cargo install miniserve
miniserve --index index.html

🔋 Batteries Included

空文件

简介

使用wasm前端浏览器读取Excel的公共库(基于Rust编译) 展开 收起
Rust
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Rust
1
https://gitee.com/Flose/excel_read.git
git@gitee.com:Flose/excel_read.git
Flose
excel_read
excel_read
master

搜索帮助