1.1.0 • Published 2 years ago

excel-paste-to-el-table v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

excel-paste-to-el-table

将 excel 一列或多列数据粘贴到 el-table 指定位置的 vue2 指令


deme

usage

  • 1.安装
npm i excel-paste-to-el-table
// 全局指令
import Vue from 'vue'
import { excelPasteToElTable } from 'excelPasteToElTable'
Vue.use(excelPasteToElTable) 

//局部指令
export default {
  directives: { 
    paste: excelPasteToElTable
  } 
}
  • 2.使用
<tempalte>
  <el-table v-paste row-key="id"></el-table>
</tempalte>
  • 3.props

proptypedescriptionrequired
row-keystring行key,详情见element文档true
propstring列属性true
formatterfunction将特殊字段的excel数据转化为table对应字段的数据false

tip

el-table的row-key必填,且必须使用string,不支持function

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago