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

alpha-vpage

v1.0.0-beta.0

Published

Vue 2.x CRUD Page Component

Downloads

3

Readme

alpha-vpage

后台管理系统基础CRUD操作交互流程封装,组件依赖:

  • vue 2.x
  • Element UI 2.x

Demo

1.注册组件


import Page from 'alpha-vpage'
import vue from 'vue'
vue.use(Page)

2.表格配置


  tableConfig = {
    columns: [
      {
        prop: 'selection',
        align: 'center',
        minWidth: '30px',
        type: 'selection'
      },
      { prop: 'clientId', label: 'Client ID' },
      { prop: 'name', label: '客户名称' },
      {
        prop: 'phone',
        label: '客户注册电话',
        formatter: this.phoneFormatter
      },
      { prop: 'email', label: '客户注册邮箱' },
      {
        prop: 'openTime',
        label: '开户时间',
        formatter: this.dateFormatter,
        sortable: true
      },
      {
        prop: 'expiryDate',
        label: '到期时间',
        formatter: this.dateFormatter
      },
      {
        prop: 'userStatus',
        label: '状态',
        formatter: this.statusFormatter
      }
    ],
    on: {
      'select-all': this.handleSelectionChange,
      'selection-change': this.handleSelectionChange
    }
  }

3.查询筛选配置

 queryFormConfig: QueryConfig<filterFormType> = {
    form: {},
    items: [
      {
        // 属性 必填
        prop: 'clientId',
        // 标签
        label: '客户ID',
        // 类型
        type: formItemTypeEnum.INPUT,
        // 监听事件,参考element-ui 该类型组件(现在是input可监听事件
        on: {
          change: this.clientIdChange
        },
        // 初始值
        value: 'init'
        // 剩余配置参数可参考element-ui 该类型(现在是input)组件可配置属性
      },
      {
        prop: 'name',
        label: '客户名称',
        type: formItemTypeEnum.INPUT
      },
      {
        prop: 'userStatus',
        label: '状态',
        type: formItemTypeEnum.SELECT,
        options: [
          { label: USER_STATUS.normal, value: 'normal' },
          { label: USER_STATUS.expired, value: 'expired' }
        ],
        value: 'normal'
      },
      {
        prop: 'phone',
        label: '手机号',
        type: formItemTypeEnum.COMPONENT,
        slot: 'q-phone'
      },
      {
        prop: 'email',
        label: '客户注册邮箱',
        type: formItemTypeEnum.INPUT
      },
      {
        prop: 'date',
        label: '测试时间',
        type: formItemTypeEnum.DATE,
        value: new Date()
      }
    ]
  }

4.html 模版

  <av-page
      :tableConfig="tableConfig"
      :queryConfig="queryFormConfig"
      :onSearch="search"
    >
      <template v-slot:q-phone="{ form }">
        
      </template>
      <template v-slot:c-orderId="{ row }">
        {{ `test column slot ${row.orderId}` }}
      </template>
    </av-page>

结果

avatar

内容

  • ~~查询筛选~~

查询Form Item 类型支持:


  export enum formItemTypeEnum {
  SELECT,
  INPUT,
  DATE,
  CHECKBOXGROUP,
  RADIOGROUP,
  COMPONENT
  }

查询Form Item 配置方法:


     {
        // 属性 必填
        prop: 'clientId',
        // 标签
        label: '客户ID',
        // 类型
        type: formItemTypeEnum.INPUT,
        // 监听事件,参考element-ui 该类型组件(现在是input可监听事件
        on: {
          change: this.clientIdChange
        },
        // 初始值
        value: 'init'
        // 剩余配置参数可参考element-ui 该类型(现在是input)组件可配置属性
      }
  • ~~表格分页排序~~
  • 弹出窗新增,批量新增(todo)
  • 修改,表格直接修改,批量修改,excel修改模式(todo)