在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:x-spreadsheet开源软件地址:https://gitee.com/mirrors/x-spreadsheet开源软件介绍:x-spreadsheet
Document
CDN<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/xspreadsheet.css"><script src="https://unpkg.com/[email protected]/dist/xspreadsheet.js"></script><script> x_spreadsheet('#xspreadsheet');</script> NPMnpm install x-data-spreadsheet <div id="x-spreadsheet-demo"></div> import Spreadsheet from "x-data-spreadsheet";// If you need to override the default options, you can set the override// const options = {};// new Spreadsheet('#x-spreadsheet-demo', options);const s = new Spreadsheet("#x-spreadsheet-demo") .loadData({}) // load data .change(data => { // save data to db });// data validations.validate() // default options{ mode: 'edit', // edit | read showToolbar: true, showGrid: true, showContextmenu: true, view: { height: () => document.documentElement.clientHeight, width: () => document.documentElement.clientWidth, }, row: { len: 100, height: 25, }, col: { len: 26, width: 100, indexWidth: 60, minWidth: 60, }, style: { bgcolor: '#ffffff', align: 'left', valign: 'middle', textwrap: false, strike: false, underline: false, color: '#0a0a0a', font: { name: 'Helvetica', size: 10, bold: false, italic: false, }, },} import | export xlsxhttps://github.com/SheetJS/sheetjs/tree/master/demos/xspreadsheet#saving-data thanks https://github.com/SheetJS/sheetjs Bind eventsconst s = new Spreadsheet("#x-spreadsheet-demo")// event of click on cells.on('cell-selected', (cell, ri, ci) => {});s.on('cells-selected', (cell, { sri, sci, eri, eci }) => {});// edited on cells.on('cell-edited', (text, ri, ci) => {}); update cell-textconst s = new Spreadsheet("#x-spreadsheet-demo")// cellText(ri, ci, text, sheetIndex = 0)s.cellText(5, 5, 'xxxx').cellText(6, 5, 'yyy').reRender(); get cell and cell-styleconst s = new Spreadsheet("#x-spreadsheet-demo")// cell(ri, ci, sheetIndex = 0)s.cell(ri, ci);// cellStyle(ri, ci, sheetIndex = 0)s.cellStyle(ri, ci); Internationalization// npm import Spreadsheet from 'x-data-spreadsheet';import zhCN from 'x-data-spreadsheet/dist/locale/zh-cn';Spreadsheet.locale('zh-cn', zhCN);new Spreadsheet(document.getElementById('xss-demo')); <!-- Import via CDN --><link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/xspreadsheet.css"><script src="https://unpkg.com/[email protected]/dist/xspreadsheet.js"></script><script src="https://unpkg.com/[email protected]/dist/locale/zh-cn.js"></script><script> x_spreadsheet.locale('zh-cn');</script> Features
Developmentgit clone https://github.com/myliang/x-spreadsheet.gitcd x-spreadsheetnpm installnpm run dev Open your browser and visit http://127.0.0.1:8080. Browser SupportModern browsers(chrome, firefox, Safari). LICENSEMIT |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论