npm.io
1.1.8 • Published 5 years ago

zm-spreadsheet

Licence
MIT
Version
1.1.8
Deps
2
Size
1.1 MB
Vulns
0
Weekly
0
Install scriptsThis package runs scripts during installation (preinstall/install/postinstall)

zm-spreadsheet

a javascript spreadsheet

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

Internationalization

// npm
import Spreadsheet from 'x-data-spreadsheet';

// If you need to override the default options, you can set the override 
// const options = {}; 
// new Spreadsheet('#v-spreadsheet-demo', options);

const s = new Spreadsheet("#v-spreadsheet-demo")
	.loadData({})
	.change(data => {
	 	// save data to db 
	})
	.saveData((state,data) => {
		// state 保存类型(save-draft 保存草稿  save 保存 save-as 另存为)
		// data 表格数据
    console.log(state, data)
  });;

// data validation
s.validate()

translate to Chinese

import zhCN from 'v-spreadsheet/src/locale/zh-cn';
Spreadsheet.locale('zh-cn', zhCN);

For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).

Keywords