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

dva-enhance

v1.1.8

Published

dva-enhance

Downloads

77

Readme

dva-enhance

NPM version NPM downloads

Description

生成增删改查模板代码的umi插件

Feature

  1. 运行命令,自动生成

  2. 目前在pages文件夹下面生成目录 目录里包含基本的list.js ,model.js, index.less,service.js

    • list.js 列表
    • model.js dvamodel
    • index.less 样式文件
    • service.js 接口方法
  3. 包含常规的一套增删改查方法

Install

# or yarn add dva-enhance --dev
$ npm install dva-enhance -D

Usage

Configure in .umirc.js,

export default {
  plugins: [
    ['dva-enhance'],
  ],
}

或者将项目拷到src目录下

export default {
  plugins: [
   ['./src/umi-plugin-page-generator/lib/index'],
  ],
}

Run

$ umi g dva:newPage [目录名] [类型]

类型可选 list

Notice

使用须知

  1. 确保安装umi-cli

开发须知

  1. lib里的是babel cmd编译之后代码 src改完要build一下

  2. 模板语法使用的是ejs 详情可见ejs官网

Change Log

  1. 去掉默认的index 改成list/index 输入第二个参数list就可以生成

  2. 写了一个list里的可变部分的配置。主要是两块,查询条件和列表column 示例

/src/generatorConfig.js
const config={
  project1:{
    columns:`[
      {
        title: '项目编码',
        dataIndex: 'code',
        key: 'code',
      }, {
        title: '项目名称',
        dataIndex: 'projectName',
        key: 'projectName',
      }, {
        title: '项目类型',
        dataIndex: 'type',
        key: 'type',
      }, {
        title: '项目属性',
        dataIndex: 'property',
        key: 'property',

      }, {
        title: '所属机构名称',
        dataIndex: 'ownerOrgName',
        key: 'ownerOrgName',
      }, {
        title: '项目状态',
        dataIndex: 'status',
        key: 'status',

      }, {
        title: '操作',
        dataIndex: 'status',
        key: 'status',
      },
    ]`,
    // label 是文字 code字段名 component 对应组件
    queryFormItems:`[
      {label:'通天塔',code:'ttt',component:<Input/>},
      {label:'麻辣鸡',code:'mlg',component:<Select/>},
      {label:'管理费',code:'glf',component:<Select/>},
      {label:'上档次',code:'sdc'}
    ]`
  }
}
module.exports=config;

3.配置father-bulid进行babel打包成符合node环境的包 4.将配置放在项目src/umi-plugin/umi-plugin-generator/lib 方便开发过程的热改动

  • 目录名 示例里的project1

  • 列表column 示例里的columns

  • 查询条件 示例里的queryFormItems

如果要生成列表的话,必须进行上述配置

LICENSE

MIT