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

lcdp-lib-form-renderer

v1.7.14

Published

LCDP LIBRARY: FORM RENDERER BASE ON VUE.JS, MAKE FORM DEVELOPMENT SIMPLE AND EFFICIENT.

Downloads

421

Readme

lcdp-lib-form-renderer 可视化表单设计器-渲染引擎

介绍

本项目使用 vue-cli 4 搭建,基于 vueelement-ui 实现。

可选参数

| 参数名 | 参数类型 | 描述 | |----------------------|---------|--------------------------------------------------| | source | Object | 表单结构信息:JSON结构数据,存放表单及其组件的详细信息 | | value | Object | 表单录入值 | | edit | Boolean | 是否为编辑状态:true = 是;false(默认) = 否 | | printRead | Boolean | 是否为打印状态:true = 是;false(默认) = 否 | | preview | Boolean | 是否为预览状态:true = 是;false(默认) = 否 | | preferPlatform | String | 终端展示类型:’pc‘ = 电脑端(默认),’pad‘ = 平板电脑,’mobile‘ = 手机 | | lockPlatform | Boolean | 是否锁定终端类型:true = 是(默认);false = 否 | | variables | Object | 引入变量:主要为当前登录用户信息 | | currentFormId | String | 表单ID | | formPublishVersionId | String | 表单发布ID |

使用示例:

1.安装:

    // 安装最新版本
    $ npm install -s lcdp-lib-form-renderer
    // 安装指定版本
    $ npm install -s lcdp-lib-form-renderer@version

2.引入:

import Vue from 'vue';
import App from './App.vue';
import ElementUI from 'element-ui';
import lcdpLibFormRenderner from 'lcdp-lib-form-renderer';
import './assets/styles/theme/element-variables.scss';
import 'remixicon/fonts/remixicon.css';
import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);
Vue.use(ElementUI, {zIndex: 2000});
lcdpLibFormRenderner.install(Vue, {}, {});
Vue.config.productionTip = false;
new Vue({
  router,
  render: h => h(App)
}).$mount('#app');

3.使用:

<template>
  <div>
    <lcdp-lib-form-renderer 
      :source="schema"
      :value="editData" 
      ref="formRenderer">
    </lcdp-lib-form-renderer>
    <el-button type="primary" @click="handleSubmit">Submit</el-button>
  </div>
</template>

<script>
export default {
  data () {
    return {
      schema: {"list":[],"config":{"labelWidth":100,"labelPosition":"right","size":"small","customClass":"","ui":"element","layout":"horizontal","labelCol":3,"width":"100%","hideLabel":false,"hideErrorMessage":false,"theme":"default","themeTitle":"","themeSubTitle":"","themeTitleAlign":"left","submitHiddenArea":false,"eventScript":[{"key":"mounted","name":"mounted","func":""},{"key":"beforeSubmit","name":"beforeSubmit","func":"// 在表单提交前调用,且返回值会影响提交结果\n// 返回值为true时会继续执行 \n// 返回值为false时会阻止提交 \n// 返回值为Error时会阻止提交 且会修改错误提示信息 return new Error('提示信息'); \nreturn true;"},{"key":"submitted","name":"submitted","func":""}]},"version":1},
      editData: {}
    }
  },
  methods: {
    handleSubmit () {
      this.$refs.formRenderer.getData().then(data => {
        // Data verification succeeded
        alert(JSON.stringify(data))
      }).catch(e => {
        // Data verification failed
      })
    }
  }
}
</script>