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

uniapp-form-generator-parser

v1.0.5

Published

uniapp的form-generator组件解析器

Downloads

12

Readme

form-generator的uniapp解析器

用于将form-generator导出的JSON解析成一个表单。

依赖

依赖于uview1.8组件库

安装组件

npm i uniapp-form-generator-parser

或者

yarn add uniapp-form-generator-parser

使用示例

查看在线示例

示例代码:

example/index.vue

注意

因为uview表单验证number类型不通过验证,故修改了uview的一点源码组件(其实就是把组件$emit事件的值转化为String字符串类型)如下:

计数器组件:u-number-box 搜索

原来为:

this.emit('input',Number(value));
value:Number(value)

修改为:

this.emit('input', String(value));
value: String(value)

评分组件:u-rate 搜索

原来为:

this.emit('change',this.activeIndex)
this.emit('change',this.activeIndex)
this.emit('input', this.activeIndex) 

修改为:

this.emit(′change′,String(this.activeIndex))
this.emit(′change′,String(this.activeIndex))
this.emit('input', String(this.activeIndex))

上传组件:u-upload 搜索 原来为:

this.showToast('超出允许的文件大小');

修改为: this.showToast(超出允许的文件大小${this.maxSize / 1024 /1024}M);

表单组件:u-form-item搜索validation方法

// 检验之间,先获取需要校验的值
this.fieldValue = this.parent.model[this.prop];

之后加入

if(Array.isArray(this.fieldValue)){//如果是数组,转成字符串型通过验证
	this.fieldValue = this.fieldValue.toString();
}

备注: 如果报错误TypeError: Cannot read property 'model' of undefined 尝试修改组件oFormParser里面setTimeout 延迟时间加长。

附件上传支持

暂时仅支持微信小程序端

在node_modules\uview-ui\components

复制u-upload-enclosure文件夹

列如

image-20211220154852639

鸣谢

源代码作者Mr.Liang

点击地址跳转