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

vue-ele-form-data-editor

v0.1.6

Published

vue-ele-form 的极简数据编辑器

Downloads

100

Readme

vue-ele-form-data-editor | vue-ele-form 的极简数据编辑器

MIT Licence npm download

介绍

image

安装

yarn add vue-ele-form-data-editor

或者

npm install vue-ele-form-data-editor --save

注册和使用

全局注册

import EleForm from "vue-ele-form";
import EleFormDataEditor from "vue-ele-form-data-editor";

// 注册 data-editor 组件
Vue.component("data-editor", EleFormDataEditor);

// 注册 ele-form
Vue.use(EleForm, {
  // 专门设置全局的 data-editor 属性
  "data-editor": {
    types: ["array", "object"],
    autoSave: false,
    // 其它属性,同 element input 组件
    // https://element.eleme.cn/#/zh-CN/component/input
    rows: 8
  }
});

局部注册

局部注册和使用请参考: https://www.yuque.com/chaojie-vjiel/vbwzgu/inlpxy#I5kdQ

使用

formDesc: {
  xxx: {
    label: 'xxx',
    // 只需要在这里指定为 data-editor 即可
    type: 'data-editor',
    attrs: {
      types: ['function', 'promise'],
      // 其它属性,同 element input 组件
      // https://element.eleme.cn/#/zh-CN/component/input
      rows: 8
    }
  }
}

示例

<template>
  <el-card
    header="ele-form-data-editor 演示"
    shadow="never"
    style="max-width: 1250px;min-height: 1000px;margin: 20px auto;"
  >
    <ele-form
      :form-data="formData"
      :form-desc="formDesc"
      :span="22"
      :request-fn="handleRequest"
      @request-success="handleSuccess"
    ></ele-form>
  </el-card>
</template>

<script>
  export default {
    data() {
      return {
        formData: {
          comic: []
        },
        formDesc: {
          comic: {
            type: "data-editor",
            label: "动漫",
            attrs: {
              types: ["array"]
            }
          }
        }
      };
    },
    methods: {
      handleRequest(data) {
        console.log(data);
        return Promise.resolve();
      },
      handleSuccess() {
        this.$message.success("提交成功");
      }
    }
  };
</script>

<style>
  body {
    background-color: #f0f2f5;
  }
</style>

attrs

参数概述

attrs: {
  // 数据类型列表
  types: {
    type: Array;
  },
  // 是否在是去焦点时自动保存,默认为 true
  autoSave: {
    type: Boolean,
    default: true
  },
  // 其它属性,同 element input 组件
  // https://element.eleme.cn/#/zh-CN/component/input
}

相关链接