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 🙏

© 2026 – Pkg Stats / Ryan Hefner

e3-my-components

v0.0.4

Published

components

Downloads

1

Readme

Install

npm install e3-my-components

Usage

init

import { createApp } from 'vue';
import App from './App.vue';

import * as myComponents from 'e3-my-components';

const app = createApp(App);
for (const [key, component] of Object.entries(myComponents)) {
  app.component(key, component);
}

app.mount('#app');

App.vue

<template>
  <div class="page">
    <myHeader></myHeader>

    <MySearch :config="config.search" @search="search"></MySearch>

    <MyOperate :config="config.operate" @handleClick="showDialog"></MyOperate>

    <MyTable
      :config="config.table"
      :optBtns="config.tableBtn"
      :data="table.tabData.value"
      :multiple="true"
      @selectionChange="tableChange"
    />

    <MyPagination :total="table.total.value" @pageChange="pageChange" />

    <MyForm
      title="表格项"
      v-model:visible="state.add"
      :config="config.form"
      :rules="config.formRules"
      :action="state.dialogAction"
      :data="state.dialogData"
      :callback="state.dialogCallback"
      @confirm="dialogConfirm"
    ></MyForm>
  </div>
</template>

<script lang="ts" setup>
import { reactive, ref } from '@vue/reactivity';
import { Pagination, TableBtn } from '@/types';
import config from './config';
import TableFn from '@/util/tableFn';
import tableApi from '@/api/modules/table';
import confirm from '@/util/confirm';
import { ElMessage } from 'element-plus';

interface List {
  id: number;
}

const multipleData = ref<List[]>([]);
const state = reactive<Record<string, any>>({
  add: false,
  dialogAction: '',
  dialogData: null,
  dialogCallback: tableApi.add,
});
const table = new TableFn({
  get: tableApi.list,
});

const handleEvent: Record<string, Function> = {
  edit: (data: List) => {
    Object.assign(state, {
      add: true,
      dialogAction: 'edit',
      dialogCallback: tableApi.edit,
      dialogData: data,
    });
  },
  delete: ({ id }: List) => {
    confirm.warning({
      message: '确认删除?',
      then: () => {
        tableApi.delete(id).then((res) => {
          ElMessage.success(res.message);
          table.getData();
        });
      },
    });
  },
};
config.tableBtn.forEach((it: TableBtn) => {
  it.callback = handleEvent[it.key];
});

function search(data: any) {
  table.search(data);
}
function pageChange(data: Pagination) {
  table.pageChange(data);
}
function tableChange(data: List[]) {
  multipleData.value = data;
}
function dialogConfirm() {
  table.getData();
}
function showDialog(key: string) {
  state[key] = true;
  if (key === 'add') {
    state.dialogAction = 'add';
    state.dialogCallback = tableApi.add;
  }
}
</script>

<style scoped></style>

config.ts


const SEXLIST = [
  { value: 0, label: '女' },
  { value: 1, label: '男' },
];

export default {
  search: [
    {
      label: '名称',
      key: 'name',
      type: 'input',
      placeholder: '请输入名称',
    },
    {
      label: '性别',
      key: 'sex',
      type: 'select',
      placeholder: '请选择性别',
      list: SEXLIST,
    },
  ],

  operate: [{ label: '添加', key: 'add', type: 'primary' }],

  table: [
    {
      prop: '',
      label: '序号',
      type: 'index',
      width: 60,
    },
    {
      prop: 'name',
      label: '姓名',
    },
    {
      prop: 'sex',
      label: '性别',
      filter: (v: number) => {
        return v == 1 ? '男' : v === 0 ? '女' : '';
      },
    },
    {
      prop: 'date',
      label: '日期',
    },
    {
      prop: 'address',
      label: '地址',
    },
  ],

  tableBtn: [
    {
      label: '编辑',
      key: 'edit',
      type: 'success',
    },
    {
      label: '删除',
      key: 'delete',
      type: 'danger',
    },
  ],

  form: [
    {
      key: 'name',
      label: '姓名',
      type: 1,
      default: '',
      placeholder: '请输入姓名',
      readonly: true,
    },
    {
      key: 'sex',
      label: '性别',
      type: 2,
      default: '',
      placeholder: '请选择性别',
      list: SEXLIST,
      readonly: false,
    },
  ],

  formRules: {
    name: [
      {
        required: true,
        message: '请输入姓名',
        trigger: ['blur', 'change'],
      },
    ],
    sex: [
      {
        required: true,
        message: '请选择性别',
        trigger: 'change',
      },
    ],
  },
};