1 Star 10 Fork 1

Essence/excel_read

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

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

Copyright (c) 2018 郭宇 <guoyumail@qq.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

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

发行版 (1)

全部
4年前

贡献者 (1)

全部

近期动态

4年前推送了新的提交到 master 分支,4fec2c0...2053047
4年前推送了新的提交到 master 分支,d2754d2...4fec2c0
4年前推送了新的提交到 master 分支,bc30a12...d2754d2
4年前推送了新的提交到 master 分支,d9cfef6...bc30a12
4年前推送了新的提交到 master 分支,c635314...d9cfef6
加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Rust
1
https://gitee.com/guoyucode/excel_read.git
git@gitee.com:guoyucode/excel_read.git
guoyucode
excel_read
excel_read
master

搜索帮助