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

jeeyor-form

v1.2.25

Published

表单校验

Downloads

13

Readme

jeeyor-form

表单校验

Build Setup

<template>
  <div id="app">
    <form-body
      style="width: 500px"
      :model="form"
      :rules="validate"
      ref="formItems"
    >
      <form-item label="用户名" dense label-left prop="name">
        <template slot="label">
          <a>(D.7.1.r.2)</a>
        </template>
        <form-input v-model="form.name" />
      </form-item>
      <form-item label="密码" label-left prop="password">
        <form-input type="password" v-model="form.password" />
      </form-item>
      <form-item label="日期" prop="date">
        <form-input type="date" v-model="form.date" />
      </form-item>
      <form-item label="日期-时间" prop="time">
        <form-input type="time" v-model="form.time" />
      </form-item>
      <form-input type="slider" />
      <form-item label="下拉框" dense prop="select">
        <form-input
          placeholder="下拉框"
          :options="options"
          type="select"
          v-model="form.select"
        />
      </form-item>

      <form-item label="文本区域" prop="textarea">
        <form-input type="textarea" v-model="form.textarea" />
      </form-item>
      <form-item label="勾选框" prop="checkbox">
        <form-input
          :options="options"
          type="checkbox"
          v-model="form.checkbox"
        />
      </form-item>
    </form-body>
    <button @click="changeButton">开始校验</button>
    {{ form }}
  </div>
</template>
export default {
  components: { formBody, formItem, formInput },
  data() {
    return {
      form: {
        name: "1",
        // time: "00:01",
      },
      validate: {
        name: [{ required: true, message: "用户名不能为空", trigger: "blur" }],
        password: [
          { required: true, message: "密码不能为空", trigger: "blur" },
        ],
        date: [
          { required: true, message: "日期不能为空", trigger: "change" },
          {
            pattern: "^\\d{4}(\\-|\\/|\\.)\\d{1,2}\\1\\d{1,2}$",
            message: "格式错误",
            trigger: "blur",
          },
        ],
        time: [
          { required: true, message: "日期-时间不能为空", trigger: "change" },
        ],
        select: [
          { required: true, message: "下拉不能为空", trigger: "change" },
        ],
        checkbox: [
          {
            required: true,
            type: "array",
            min: 1,
            message: "至少选择一个",
            trigger: "change",
          },
        ],
      },
      options: [
        { text: "111", value: "111" },
        { text: "222", value: "222" },
      ],
    };
  },
  mounted() {
    for (let i = 0; i < 10; i++) {
      this.options.push({
        text: i + "txt",
        value: i.toString(),
        disable: i === 2,
      });
    }
  },
  methods: {
    changeButton() {
      // this.$refs.formItems.resetFields();
      this.$refs.formItems.validate().then((res) => {
        console.log(res);
      });
    },
  },
};
1.1.0 修复下拉框定位问题
1.1.1 删除水平线属性
1.1.2 新增列表控件
1.1.3 修复bug
1.1.5 新增开关控件
1.1.6 修复bug
1.1.8 开关控件增加校验
1.1.9 动态正则修改
1.2.0 列表控件增加自定义字段和携带对象
1.2.1 修复bug
1.2.3 修复缺少字段校验不返回表单校验结果
1.2.4 修复清除数据时不清除异常提示
1.2.5 清除数据回到默认数据
1.2.6 调整开关控件样式
1.2.7 调整禁用属性 及日期选择控件
1.2.8 日期选择控件样式调整
1.2.9 更新评分控件、滑动条控件、富文本控件、上传控件(测试)
陆续开放组件...
作者QQ:931943819