Giter Site home page Giter Site logo

table-columns-custom-tool's Introduction

说明:

一个长列表的自定义列工具。适用于vue和element-ui搭建的系统。

th、td属性:

  • alwaysShow 列一直显示,自定义列弹窗里不会出现

props:

  • related-table-class 要绑定的table的className
  • cache-name 用于存储已选列的索引值的localStorage名
  • render-by-class 通过数据列class名渲染,主要针对存在合并单元格的情况,这时default-checked传class名组成的数组
  • default-checked 数组,默认展示数据列的索引号或class名

使用

npm i table-columns-custom-tool
<el-button type="primary" size="small" @click="onCustomTable"><i class="el-icon-setting"></i></el-button>

...
<table>
...
</table>

...

<table-columns-custom 
    ref="tableCustomModal"
    related-table-class="js-list"
    :default-checked="[0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12]"
    cache-name="XX_XX_LIST_FIELDS">
</table-columns-custom>
import TableColumnsCustom from 'table-columns-custom-tool';

...

components: {
    TableColumnsCustom
},

methods: {
	getData () {
		getRemoteData.then(res => {
			this.list = res.list;
			//获取数据后,触发重新渲染表格
			this.$nextTick(() => {
		        this.$refs.tableCustomModal.init();
		    });
		});		
	},

	onCustomTable () {
		this.$refs.tableCustomModal.showModal();
	}
}

图示

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.