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

formx-vue2

v0.1.48

Published

------ ## 引入 ``` npm install formx-vue2 ``` ```javascript main.js import "formx-vue2/lib/formx-vue2.css" import formx from "formx-vue2" Vue.use(formx) ```

Downloads

12

Readme

此项目封装了一些常用组件,目前包含表单、数字滚动组件,此后将持续进行更新完善。。。

基于[email protected][email protected]


引入

    npm install formx-vue2
    main.js
    import "formx-vue2/lib/formx-vue2.css"
    import formx from "formx-vue2"
    Vue.use(formx)

表单

    <WyForm :options = "formOptions"  style="width:50%;margin:0 auto;"/>
    formOptions: {
        disabled: true,//不能编辑,比field中disabled优先级低
        theme: "white",//主题色
        formLayout: "inline",//horizontal|vertical|inline
        formItemLayout: {
          labelCol: {
            span: 4
          },
          wrapperCol: {
            span: 20
          }
        },
        actions: {
          layout: "rowHEndVCenter",//rowHCenterVCenter | rowHCenterVStart | rowHEndVCenter | rowHBetweenVStart | rowHBetweenVCenter | rowHBetweenVEnd | rowHStartVStart | rowHStartVBetween |  rowHStartVCenter | rowHEndVCenter | columnHStartVStart | columnHStartVCenter |
          buttons: [
            {
              show: false,//是否显示
              key: "submit",
              style: { width: "100px", marginRight: "20px" },
              text: "提交",
              type: "primary",
              manual: true,//是否自定义保存
              callback: this.submit,//提交 设置manual为true才会调用此方法
              callbackSuccess: this.summitSuccess,//保存成功
              callbackFailure: this.submitFailure,//保存失败
            },
            {
              show: false,
              key: "cancel",
              style: { width: "100px", marginRight: "20px" },
              text: "取消",
              manual: true,//是否自定义取消
              callback: this.cancel,//取消
            },
            {
              show: true,
              key: "edit",
              style: { width: "100px", marginRight: "20px" },
              text: "编辑",
              manual: true,//是否自定义编辑
              callback: this.edit,//编辑
            },
          ]
        },
        fields: [
          {
              key: "startTime",
              label: "开始时间",
              type: "date-picker",
              showTime: true,//是否显示小时分秒
              initValue: "",//初始值
              trigger: "blur",//何时触发校验
              validateReg: "^[0-9-:\\s\\/]+$",//校验正则
              validateErrorMessage: "日期为必选项",//校验失败提示信息
              style: { width: "48%", marginRight: "2%"  }
          },
          {
              key: "endTime",
              label: "结束时间",
              type: "date-picker",
              showTime: true,//是否显示小时分秒
              initValue: "",//初始值
              trigger: "blur",//何时触发校验
              validateReg: "^[0-9-:\\s\\/]+$",//校验正则
              validateErrorMessage: "日期为必选项",//校验失败提示信息
              style: { width: "48%", marginRight: "0"  }
          },
          {
              key: "xxx",
              label: "xxx",
              type: "input-number",
              unit: "%",
              placeholder: "请输入0 ~ 100的数值",
              initValue: null,//初始值
              validateReg: value => {
                if(value && value >=0 && value <= 100){
                  return true;
                }
                return false;
              },//校验函数
              trigger: "blur",//何时触发校验
              validateErrorMessage: "xxx在0 ~ 100之间",//校验失败提示信息
              style: { width: "48%", marginRight: "2%" }
          },
          {
              key: "yyy",
              label: "yyy",
              type: "input-number",
              unit: "%",
              placeholder: "请输入100 ~ 120的数值",
              initValue: null,//初始值
              validateReg: value => {
                if(value && value >=100 && value <= 120){
                  return true;
                }
                return false;
              },//校验函数
              trigger: "blur",//何时触发校验
              validateErrorMessage: "yyy值在100 ~ 120之间",//校验失败提示信息
              style: { width: "48%", marginRight: "2%" }
          },
          {
              key: "zzz",
              label: "zzz",
              type: "input-number",
              unit: "%",
              placeholder: "请输入0 ~ 100的数值",
              initValue: null,//初始值
              validateReg: value => {
                if(value && value >=0 && value <= 100){
                  return true;
                }
                return false;
              },//校验函数
              trigger: "blur",//何时触发校验
              validateErrorMessage: "放电效率值在0 ~ 100之间",//校验失败提示信息
              style: { width: "48%", marginRight: "2%" }
          },
          {
              key: "sss",
              label: "sss",
              type: "select",
              list: [{key: "充电", value: "1"}, {key: "放电", value: "2"}],//可选值
              initValue: "2",//初始值
              trigger: "blur",//何时触发校验
              validateReg: "^[^\s]+$",//校验正则
              validateErrorMessage: "sss为必选项",//校验失败提示信息
              style: { width: "48%", marginRight: "0"  }
          },
          {
            key: "sex",
            label: "性别",
            type: "radio",
            list: [{key: "男", value: "1"}, {key: "女", value: "2"}],//可选值
            initValue: "2",//初始值
            validateReg: "^[^\s]+$",//校验,支持正则
            validateErrorMessage: "性别为必选项",//校验失败提示信息
            style: { width: "30%", marginRight: "0" }
          },
        ]
      }

说明

自动生成form表单组件暂时只能自定义保存

数字滚动

示例

     <WyDigitRoll :value="num" decimal=4 unit="元" :showDelta="true" split=","></WyDigitRoll>

说明

| 参数 | 说明 | 是否可选 | 默认值 | | :--------: | :-----: | :----: | :----: | | value | 数值 | 必填 | -- | | decimal | 保留小数位 | 可选 | 3 | | unit | 单位 | 可选 | "" | | showDelta | 是否显示变化差值 | 可选 | false | | split | 分隔符 | 可选 | "" | | fontSize | 字体大小 | 可选 28、24、22、18、14 | 28 |