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

j-form-table

v0.0.17

Published

数据驱动的表单式组件

Readme

form-table 表单式表格

表单式表格,使用时只需要传需要展示的标题和数据.

基于 element-ui 2.x

LICENSE

安装

npm i j-form-table

在 vue 应用的入口文件中使用:

import FormTable from 'form-table'
Vue.use(FormTable)
// 可全局配置 title 的宽度 默认是 120 单位 px
Vue.use(FormTable, { titleWidth: 150 })

常用 props

| prop | 说明 | 类型 | 是否必需 | 默认值 | 其他 | | :------------: | :-------------------------: | :--------------------: | :------: | :----: | :-----------------: | | titleList | 组件配置 | []{title:'',prop:''} | 是 | | `` | | data | 从该属性中取值来展示 | Object | 否 | {} | | | title | 整个组件的标题 | String | 否 | '' | | | titleWidth | 标题宽度 | Number | 否 | 120 | 单位为px | | titleNumPreRow | 一行有几个titleprop对 | Number | 否 | 3 | 只能是1,2,3,4,5,6 |

基本用法

配置 titleListdata 即可展示数据;

<template>
  <div>
    <FormTable title="使用例子" :data="data" :titleList="titleList" />
    <FormTable
      title="使用例子"
      :data="data"
      :titleList="titleList"
      :titleWidth="150"
    />
  </div>
</template>

<script>
  const img =
    'https://tva1.sinaimg.cn/large/008i3skNgy1gu9gco1hdbj605k05kgll02.jpg'
  export default {
    name: 'App',
    data() {
      return {
        data: {
          name: 'LiHei',
          image: img,
          job: 'web dev',
          slary: '3000',
          address: '四川省成都市成华区十里店寺庙',
          education: '本科',
          isGood: 1
        },
        titleList: [
          { title: '姓名', prop: 'name' },
          {
            title: '头像',
            // 自定义 title 属性值
            titleTips: data => {
              return (data.image && '生成图,点击放大') || '暂无头像'
            },
            prop: (h, data) => {
              return (
                <div style={{ width: '50px', height: '200px' }}>
                  <img src={data.image} alt='我的头像:超级无敌美丽' />
                </div>
              )
            }
          },
          {
            title: '职业',
            prop: 'job'
          },
          {
            title: '月薪',
            prop: (h, data) => {
              return <span>{data.slary + '$'}</span>
            },
            enableCopy: true // 开启点击赋值内容
          },
          {
            title: '住址',
            prop: 'address',
            enableCopy: true,
            span: 2
          },
          {
            title: '学历',
            prop: 'education',
            span: 1
          },
          {
            title: '是否统招',
            prop: (h, data) => {
              const map = { 0: '否', 1: '是' }
              return <span>{map[data.isGood]}</span>
            },
            span: 2
          }
        ]
      }
    }
  }
</script>

效果

上述渲染效果