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

xiaoxi-pctable

v1.0.13

Published

基于elementUi 管理后台的 table组件

Downloads

15

Readme

使用前准备工作如下:

1 下载依赖包

npm install xiaoxi-pctable -S

2. 在项目入口文件中注入此vue 插件

import PcElTable from 'xiaoxi-pctable' Vue.use(PcElTable)

备注: 注入插件前,必须以及注入好了ajax服务, 例如: Vue.prototype.$post = post ; 否则将post 服务给插件 Vue.use(PcElTable, { '$post': post })

备注2: Vue.use(PcElTable,{name:'pctable'}) //可以通过给name 传值的方式自定义命名 组件名

使用方式

1. 提供自定义的table配置文件: 配置文件如下

export default { restApiUrl: '/order/recoup', // 查询table列表接口地址 headerFixed: true, // 固定表头 selection: false, // 批量选项 keys: [], // 批量处理的键值 actionColFixed: false, // 固定列 border: false, // 是否带线 actionButtons: false, // 操作列 actionButtonsFxied: 'left', // 操作列固定位置 actionColWidth: 350, align: 'center', expandColumn: false, // 扩展项 expandRowKey: 'id' // 扩展项默认唯一属性值 }

2. 提供table 需要展示的字段配置 : 举例

export const defaultCols = [ { label: '补量订单ID', minWidth: 100, key: '_id', type: 'text', //文本类型展示 fixed: true //是否固定列 }, { label: '启动时间', key: 'startTime', type: 'date' //日期类型展示

}, { label: '消费金额', key: 'money', type: 'amount' //金额类型展示

},

{ label: '国家', innerSlot: 'col-cloumns-country' //自定义展示【插槽】

}, ].map(config => { return { ...config } })

3.在.vue 文件中直接使用

   <pctable
    v-loading="loading"
    ref="tableList"
    v-model="queryParams"
    :expand-keys="expandKeys"
    :config="config"
    :callback="handleTableData"
    @changePage="changePage"
  >

   <!-- 自定义插槽展示方式-->
    <template #col-cloumns-country="{ row }">
      具体内容
    </template>
  </pctable>       

pctable 对外暴露的接口有:

input: 监听分页|排序 操作 handle-selection-change: 监听多选项 handle-cell-click: 监听点击当前行