GithubHelp home page GithubHelp logo

excel2js's Introduction

Cocos Creator 插件:转换 excel 文件为 js 文件


如何使用

参考 Cocos Creator 插件的安装与分享

注意事项

  • excel 的读取路径为 项目目录/excel/
  • js 文件保存路径为 项目目录/assets/data/
  • 转换成功后,会以同名的 js 文件保存,请自行做好文件备份
  • !开头的 excel 文件会被忽略,以!开头的 excel 字段名同样会被忽略
  • excel 文件第一行为字段名,第二行起为数据
  • 每个 excel 文件只会解析第一个表格
  • 支持解析 .xlsx 的 excel 文件

转换格式

  • excel
id name num object array
0 "名字0" 0 {a:1,b:2} [0,1,2]
1 "名字1" 1 {a:1,b:2} [0,1,2]
2 "名字2" 2 {a:"对象1",b:"对象1"} ["数组1","数组2"]
3 "名字3" 3 {a:"对象1",b:"对象1"} ["数组1","数组2"]
  • js
module.exports = [ 
  {id:0, name:"名字0", num:0, object:{a:1,b:2}, array:[0,1,2]}, 
  {id:1, name:"名字1", num:1, object:{a:1,b:2}, array:[0,1,2]}, 
  {id:2, name:"名字2", num:2, object:{a:"对象1",b:"对象1"}, array:["数组1","数组2"]}, 
  {id:3, name:"名字3", num:3, object:{a:"对象1",b:"对象1"}, array:["数组1","数组2"]}, 
];

截图

excel2js's People

Contributors

fusijie avatar

Stargazers

Quan Nguyen avatar zennia avatar  avatar  avatar 国良 avatar  avatar  avatar Reyn avatar  avatar 小马哥nice avatar 超级大蘑菇头 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.