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

jz-search-table

v1.0.2

Published

search-table component by element-plus

Downloads

3

Readme

search-table

基于element-plus封装的search、table组件

JzSearch、JzTable的使用

import {JzSearch, JzTable} from "jz-search-table";
export default {
  name: "App",
  components: {
    JzSearch,
    JzTable,
  },
}

JzSearch的参数

<JzSearch
      :config="searchConfig"
      :query="query"
      @onSearch="onSearch"
      @onCancel="onCancel"
    >
      <template v-slot:idNo>
        <el-input
          v-model="query.idNo"
          placeholder="请输入身份证"
          :style="{ width: '250px' }"
        />
      </template>
</JzSearch>

config: [
     labelWidth: String, (非必填, 查询条件名称宽度)
     name: String, (必填, 查询条件名称)
     key: String, (必填, 查询条件对应字段)
     type: String, (必填, 查询条件类型, type值为slot时候支持插槽)
     attrs: Object, (必填, element对应组件支持的参数,可以传入style,不传情况下默认宽度200px)
     options: Array, (非必填, element对应组件有option的必填)
     optionAttrs: Array, (非必填, element对应组件有option的必填)
]
query: Object 存储查询条件值的对象
isLoading: Boolean 查询按钮的loading状态

const searchConfig = ref([
      {
        label: "状态",
        type: "select",
        key: "insurance",
        attrs: {
          placeholder: "请选择项目状态",
          clearable: true,
          style: { width: "250px" },
        },
        options: [
          { label: "启用", value: "1" },
          { label: "禁用", value: "2" },
        ],
        optionAttrs: { label: "label", value: "value", key: "value" },
      },
      {
        label: "姓名",
        type: "input",
        key: "name",
        attrs: { placeholder: "请输入姓名", clearable: true },
      },
      { label: "身份证", type: "slot", key: "idNo" },
      {
        label: "创建时间",
        type: "daterange",
        key: "daterange",
        attrs: {
          startPlaceholder: "开始日期",
          endPlaceholder: "结束日期",
          editable: false,
          type: "daterange",
        },
      },
 ]);

JzTable的参数

<JzTable
      :config="tableConfig"
      :attrs="tableAttrs"
      :paginationConfig="paginationConfig"
      style="margin-top: 20px"
      title="示例列表"
      @cell-click="cellClick"
      @pageSizeChange="pageSizeChange"
      @currentPageChange="currentPageChange"
    >
      <template v-slot:operation>
        <el-button type="primary">新增</el-button>
        <el-button type="primary">导出</el-button>
      </template>
      <template v-slot:address>
        <el-table-column label="地址">
          <template #default="scope">
            {{ scope.row.address }}
          </template>
        </el-table-column>
      </template>
</JzTable>

title: String 列表标题
config: Array 列表配置 对应el-table-column的参数
attrs: Object 列表参数 对应el-table的参数
paginationConfig: Object 对应el-pagination的参数

const tableConfig = ref([
      { label: "日期", prop: "date", fixed: "right" },
      { label: "姓名", prop: "name", formatter: formatterName },
      { label: "地址", prop: "address", type: "slot" },
]);
const paginationConfig = ref({
      currentPage: 1,
      pageSize: 10,
      total: 100,
});
const tableAttrs = ref({
      border: true,
      data: [
        {
          date: "2016-05-03",
          name: "Tom",
          address: "No. 189, Grove St, Los Angeles",
        },
        {
          date: "2016-05-02",
          name: "Tom",
          address: "No. 189, Grove St, Los Angeles",
        },
      ],
});