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

dynamic-table-y

v1.1.5

Published

基于Vue的表单设计器,让表单开发简单而高效

Downloads

17

Readme

dynamic-table-y

简介

根据JSON数据生成表格,同时配置有查询,删除,表单新增,编辑的功能。同时可以在设计页面进行表单组件位置的排放及属性调整。请将生成的Json放到Parser中预览。

安装

npm install dynamic-table-y --save ​

使用

// main.js import { DynamicTable, Parser } from 'dynamic-table-y' Vue.component(DynamicTable.name , DynamicTable) Vue.component(Parser.name, Parser)

DynamicTableY表格(表单)设计器

| 属性 | 描述 | 类型 | 默认值 | | :-------- | :------------------------------------------------ | :----- | :----- | ymodelId | 模型ID,用来获取表格行字段, 展示出可配置的表格 | String | Number | undefined | | yuniKey | 配置完成后组件的标识唯一,用来获取完整的JSON数据 | String | undefined |

desgin.vue
<template>
  <div style="height:100%">
    <DynamicTable
      :ymodel-id="modelId"
      :yuni-key="uniKey"
    />
  </div>
</template>

<script>
import preview from './perview.vue'
export default {
  name: 'EasyTablea',
  components: {
    preview
  },
  data() {
    return {
      modelId: 2,
      uniKey: 'dddd_eijiofds'
    }
  },
  created() {
    
  }

}

Parser解析器(使用TS + JSX编写)

| 属性 | 描述 | 类型 | 默认值 | | :-------- | :------------------------------------------------ | :----- | :----- | tableConfigLocal | 获取到的表格基础字段 | String | Number | undefined | | renderForm | 是否渲染表单的控制开关 | Boolean | false | | permissionButtons | 权限控制列表,权限标识符的格式如下所示,具体情况安装实际项目调整 | Array | [] | |formListConfig | 表单JSON数据,renderForm为true,这个字段必须传 | JSON | - |

preview.html
<template>
  <div>
    <Parser 
      :table-config-local="tableConfig" 
      :render-form="renderForm" 
      :form-list-config="formListConfig" 
      :model-id="modelId" 
      :permission-buttons="permissionButtons"
    />
  </div>
</template>
<script>
import axios from 'axios'
export default {
  name: 'DynamicPreview',
  props: {
    uniKey: {
      type: String,
      required: true
    }
  },
  data() {
    return {
      permissionButtons: ['projectName:tableName:typeName', 'myapp:user:index', 'myapp:dashbord:delete' ],
      loading: false,
      tableConfig: {},
      dialogVisible: true,
      renderForm: false,
      formListConfig: {},
      modelId: undefined
    }
  },
  created() {
    this.loading = true
    后端数据格式为:
    const data = {
      table: {},
      form: {},
      modelId: {}
    }
    this.tableConfig = data.table
    this.modelId = data.modelId
    const formd = data.form
    if (formd) {
      this.renderForm = true
      this.formListConfig = formd
    }
  }
}
</script>