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

h5-form-render

v0.1.25

Published

### 属性 ```js props: { // 表单id argFormId: String, // 表单数据id argDataId: String, // 表单数据 argFormData: { type: Object, default () { return null } }, // 是否手动提交 ifManualSubmit: Boolean, // 模式 默

Downloads

9

Readme

h5-form-parser

属性

  props: {
    // 表单id
    argFormId: String,
    // 表单数据id
    argDataId: String,
    // 表单数据
    argFormData: {
      type: Object,
      default () {
        return null
      }
    },
    // 是否手动提交
    ifManualSubmit: Boolean,
    // 模式 默认编辑 
    argMod: String, // edit: 编辑  preview: 预览
  }
  // event
  submit(form) form: 表单数据
  getFormData() 获取表单数据提交

备注

  • 数据回填优先级
    • argFormData
    • 表单已设置loadApi,则会使用loadApi请求回来的数据
    • 根据argDataId,调用默认接口请求回来的数据
    • 不回填数据
  • 提交
    • 表单不提供提交按钮,开发者需要自己调用 this.$refs.xxx.getFormData() 获取表单数据提交
    • 表单提供提交按钮
      • ifManualSubmit 为真,则监听组件 submit 方法,参数是表单数据
      • ifManualSubmit 为假,则优先提交到表单设置的 saveApi 接口,如果未设置 saveApi 则提交至默认接口
      • 可监听 OnSubmitFormSuc 事件,来自定义处理表单成功提交的业务逻辑

例子

  // main.js 全局引入
  import H5FormRender from 'h5-form-render'
  Vue.use(H5FormRender)
  <template>
    <H5FormRender
      arg-form-id="fd16da5eaf634d869861f6144f8f3c4f"
      :arg-form-data="argFormData"
      :if-manual-submit="true"
      @submit="submit"
      ref="xxx"
    />
  </template>
  <script>
    // 局部引入
    import H5FormRender from 'h5-form-render'
    export default {
      name: 'Example',
      components: {
        H5FormRender
      },
      data () {
        return {
          argFormData: {
            usr: 'zhangsan',
            pwd: '999',
            age: '19',
            sex: 1
          }
        }
      },
      methods: {
        submit (form) {
          console.log('xx ', form)
        },
        getFormData() {
          console.log('xx2 ', this.$refs.xxx.getFormData())
        }
      }
    }
  </script>