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

mill-element-component

v1.1.5

Published

Downloads

4

Readme

AutoTable

tableMeta: [
  {
    prop: "date",
    label: "出生日期",
    width: "180"
  }, {
    prop: "name",
    label: "姓名",
    width: "180"

  }, {
    prop: "address",
    label: "地址",
  }
]

data

tableData: [{
    id: 1,
    date: '2016-05-02',
    name: '王小虎',
    address: '上海市普陀区金沙江路 1518 弄'
  }, {
    id: 5,
    date: '2016-05-04',
    name: '王小虎',
    address: '上海市普陀区金沙江路 1517 弄'
  }, {
    id: 6,
    date: '2016-05-01',
    name: '王小虎',
    address: '上海市普陀区金沙江路 1519 弄',
    children: [
      {
        id: 7,
        date: '2016-05-32',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }
    ]
  }, {
    id: 8,
    date: '2016-05-03',
    name: '王小虎',
    address: '上海市普陀区金沙江路 1516 弄'
  }]

AutoForm

formMeta: {
  items: [
    {
      label: "明星们",
      name: "girls",
      type: "array",
      describe: "举办活动的名称",
      default: ["manyu", "shuzhen"],
      options: [
        { label: "朱茵", value: "zhuyin" },
        { label: "张曼玉", value: "manyu" },
        { label: "邱淑贞", value: "shuzhen" },
        { label: "梅超风", value: "chaofeng" },
        { label: "赵敏", value: "zhaomin" }

      ],
      rules: [
        { required: true, message: "活动名称必须填写" }
      ]
    },
    {
      label: "活动名称",
      name: "activitName",
      type: "string",
      describe: "举办活动的名称",
      default: "营销活动",
      rules: [
        { required: true, message: "活动名称必须填写" },

      ]
    },
    {
      label: "是否影帝",
      name: "isJitou",
      type: "boolean",
      describe: "举办活动的名称",
      default: true,
      rules: [
        { required: true, message: "活动名称必须填写" },

      ]
    }, {
      label: "获奖数量",
      name: "jiCnt",
      type: "number",
      describe: "举办活动的名称",
      default: 50,
      rules: [
        { required: true, message: "活动名称必须填写" },
        { type:"number", min: 20, max: 80 ,message:"怎么说话的"}
      ]
    },
    {
      label: "活动内容",
      name: "activitContent",
      type: "string",
      describe: "举办活动的内容",
      require: true,
      default: "营销活动",
      rules: [
        { max: 30, min: 10, message: "必须在10~30个字符以内" }
      ]
    }, {
      label: "城市",
      name: "city",
      type: "menu",
      describe: "活动举办的城市",
      default: "shengzhen",
      options: [
        { label: "北京", value: "beijing" },
        { label: "上海", value: "shanghai" },
        { label: "深圳", value: "shengzhen" },
        { label: "广州", value: "guangzhou" },
      ],
      rules: [
        { required: true, message: "活动名称必须填写" }
      ]
    }
  ]
},

需要完善

  1. 批量删除
  2. 分页
  3. 表格中树的级别管理
<template>
<el-tabs class="form-table-tabs" v-model="activeName">
    <el-tab-pane label="" name="first">
      <el-table size="mini" :data="value" style="width: 100%">
        <el-table-column v-for="(col,i) in tableMeta" :key="i" :prop="col.name" :label="col.label" > </el-table-column>
        <el-table-column
          fixed="right"
          label="操作"
          width="70">
          <template slot-scope="scope">
            <el-button-group>
              <el-popconfirm title="这是一段内容确定删除吗?" @confirm="handleClick(scope)">
            <el-button slot="reference"  type="text" size="mini" icon="el-icon-delete"></el-button>
              </el-popconfirm>
            <el-button type="text" size="mini" icon="el-icon-edit" @click="goEdit(scope)"></el-button>
            
            </el-button-group>
          </template>
        </el-table-column>
      </el-table>
        <el-button type="text" size="mini" icon="el-icon-plus" @click="activeName='second'"></el-button>
        </el-tab-pane>
        <el-tab-pane label="" :disabled="disabledForm" name="second">
          <auto-form ref="autoForm" size="mini" @form-confirm="addConfirmHandle" @form-cancle="activeName = 'first'" :formMeta="formMeta"></auto-form>
        </el-tab-pane>
        <el-tab-pane label="" :disabled="disabledForm" name="threed">
          <auto-form ref="editForm" :formData="editRow" size="mini" @form-confirm="editConfirmHandle" @form-cancle="activeName = 'first'" :formMeta="formMeta"></auto-form>
        </el-tab-pane>
</el-tabs>
</template>
<script>

function deepClone(data){
      return JSON.parse(JSON.stringify(data))
    }
export default {
  props: {
    value: {
     
    },
    formMeta: {
      required: true
    }
   
  },
  data(){
    return {
      disabledForm: true,
      activeName: "first",
      editIndex: -1,
      editRow: {}
      
    }
  },
  computed:{
    tableMeta(){
      return this.formMeta.items.filter(e=>e.isCol)
    }
  },
  methods:{
    
    handleClick(row){
      this.value.splice(row.$index,1)
      this.$emit("input",this.value)
    },
    addConfirmHandle(data){
      this.value.push(deepClone(data))
      this.$refs.autoForm.onReset()
    },
    editConfirmHandle(data){
      this.value.splice(this.editIndex,1,deepClone(data))
      this.$refs.editForm.onReset()
    },
    goEdit({$index,row}){
      this.activeName='threed';
      this.editIndex = $index ;
      this.$set(this,'editRow',deepClone(row))
    }
  }
};
</script>
onReset(){
      this.$refs.form.resetFields()
      this.$emit("form-cancle", this.formData)
    }
 FormitemTable(v-model="form.tb",:formMeta="formMeta")


formMeta: {
        items: [
          {
            label: "日期",
            name: "date",
            type: "string",
            describe: "举办活动的内容",
            require: true,
            default: "营销活动",
            isCol: true,
            rules: [
              { max: 30, min: 10, message: "必须在10~30个字符以内" }
            ]
          }, {
            label: "姓名",
            name: "name",
            type: "string",
            describe: "举办活动的内容",
            require: true,
            default: "营销活动",
            isCol: true,
            rules: [
              { max: 30, min: 10, message: "必须在10~30个字符以内" }
            ]
          }, 
          
        ]
      },
      form: {
        tb: [
          {
            date: "2016-05-02",
            name: "王小虎",
            address: "上海市普陀区金沙江路 1518 弄",
          },
          {
            date: "2016-05-04",
            name: "王小虎",
            address: "上海市普陀区金沙江路 1517 弄",
          },
          {
            date: "2016-05-01",
            name: "王小虎",
            address: "上海市普陀区金沙江路 1519 弄",
          },
          {
            date: "2016-05-03",
            name: "王小虎",
            address: "上海市普陀区金沙江路 1516 弄",
          },
        ],
      },