npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eltabel-custom-header

v0.1.1

Published

Element UI Table Custom Headers

Downloads

4

Readme

eltabel-custom-header

element UI table 自定义表头

可以很简单的实现自定义表头,对原始代码侵入很少。 支持缓存 前端缓存和后端缓存。 支持一个页面多个table使用 只需要简单的混入,并给table 设置一个ref 即可实现

Usage

npm i eltabel-custom-header  --save

import { CostomTable } from 'eltabel-custom-header'
// 混入
mixins: [CostomTable({ref: 'table' }), CostomTable({ref: 'table2'})],

// 参数
isCache: true,
ref: 'table',
// 是否过滤操作
hasHandle: true,
// hasHandle为true的时候  过滤标题为handleName的列名
handleName: '操作',
// 缓存可以是后端的接口   默认缓存到localStorage  
cacheAPI: {
    get: (ref) => {
        return JSON.parse(localStorage.getItem(getLocalStorageKey(ref)))
    },
    set: (CheckList, ref, item) => {
        localStorage.setItem(getLocalStorageKey(ref), JSON.stringify([...CheckList]))
    },
}


// 表格使用 示例
<el-table-column
prop="operate"
label="操作">
<template slot="header">
    <span>操作</span>
    <el-popover
        title="操作"
        width="100"
        trigger="hover">
        <el-checkbox-group 
        v-model="mixinCheckDatatable"
        style="margin-left: 6px;display: flex;flex-direction: column"
        >
            <el-checkbox @change="handleCheckedTableColumnsChangetable(data)" v-for="data in mixinAllDatatable" :label="data.id" :key="data.id">{{ data.label }}</el-checkbox>
        </el-checkbox-group>
        <i slot="reference" style="margin-left: 5px;color: #1989fa;cursor: pointer;" class="el-icon-s-tools"></i>
    </el-popover>
</template>
</el-table-column>

// 按钮使用实例
<el-checkbox-group 
    v-model="mixinCheckDatatable2"
    style="margin-top: 20px;margin-left: 20px;"
    >
    <el-checkbox @change="handleCheckedTableColumnsChangetable2(data)"  v-for="data in mixinAllDatatable2" :label="data.id" :key="data.id">{{ data.label }}</el-checkbox>
</el-checkbox-group>

代码实例 app.vue文件

describe

混入会插入 data 变量 mixinAllDatatable ('mixinAllData' + ref) mixinCheckDatatable ('mixinCheckData' + ref) methods 方法 handleCheckedTableColumnsChangetable ('handleCheckedTableColumnsChange' + ref)