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

table-list-page

v0.1.3

Published

基于vue+element开发的tableList页面组件,免得项目重复写table页面

Downloads

2

Readme

table-list-page

基于vue + element 封装的表格页面,内容包括:搜索, 表格显示, 分页, 减少重复写页面才封装的

install

npm install table-list-page -s

Quick Start

import Vue from 'vue'
import TableList from '../packages/index'
Vue.use(TableList)


<TableList
 :formModel="formModel"
 :formItem="formItem"
 :tableData="tableData"
 :tableColumn="tableColumn"
 :page="page"
 @onSearch="search"
 @currentChange="currentChange"
>

<!-- search slot -->
<div slot="searchForm">
        <el-row>
          <el-col>
            <input placeholder="请输入" v-model="formModel.city" />
          </el-col>
        </el-row>
      </div>
<!-- search btn slot -->
<div slot="searchBtn>
  <el-button type="primary" size="small" @click.stop="search" v-else>搜索</el-button>
</div>

<!-- table column slot  -->	  
      <div slot="tableColumn">
        <el-table-column
          prop="status"
          label="状态" />
        <el-table-column
          label="操作"
          width="100">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
            <el-button type="text" size="small">编辑</el-button>
          </template>
        </el-table-column>
      </div>


</TableList>

parameter

参数 | 说明 | 类型 ---|---|--- formModel | 搜索绑定的model值 | Object formItem | 搜索表单组件内容, 默认支持input,select两种表单组件,可通过参数配置 | Array tableData | 表格显示内容 | Array tableColumn | 表格头部绑定数据 | Object page | 分页配置 | Object onSearch | 搜索方法函数 | Function currentChange | 分页切换函数 | Function

formModel

formModel: {
	city: '',
	county: '',
	grid: '',
	taskName: ''
},

formItem

formItem: [
        {
          label: '地市',
          col: 6,
          model: 'city',
          type: 'select',
          width: '280px',
          size: 'small',
          optionList: [
            {
              value: '选项1',
              label: '黄金糕'
            }, {
              value: '选项2',
              label: '双皮奶'
            },
          ]
        },
        {
          label: '区县',
          col: 6,
          model: 'county',
          type: 'select',
          width: '280px',
          size: 'small',
          optionList: [
            {
              value: '选项1',
              label: '黄金糕'
            }, {
              value: '选项2',
              label: '双皮奶'
            }
          ]
        },
        {
          label: '网格',
          col: 6,
          model: 'grid',
          type: 'select',
          width: '280px',
          size: 'small',
          optionList: [
            {
              value: 'ningbo',
              label: '宁波'
            }, {
              value: 'hanghou',
              label: '杭州'
            }
          ]
        },
        {
          label: '任务名',
          col: 6,
          model: 'taskName',
          type: 'input',
          width: '280px',
          size: 'small',
        },
      ],

tableData

tableData: [
        {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄',
          status: '优化'
        },
      ],

tableColumn

tableColumn: [
        {
          prop: 'date',
          label: '日期',
          width: '',
          isFixed: false,
          fixedPos: '',
          showTooltip: false
        },
	]

page

page: {
        background: true,
        hideOnSinglePage: false,
        total: 50,
        pageIndex: 2,
        pageSize: 20,
        layout: 'prev, pager, next'
      }
	  ```