@charrue/schema-form-next
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

charrue-schema-form

基于element-ui和element-plus快速实现表单

安装依赖

npm install @charrue/schema-form-next

添加引用

import { createApp } from "vue";
import App from "./App.vue";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import CharrueSchemaForm from "@charrue/schema-form-next";

const app = createApp(App);

app.use(ElementPlus);
app.use(CharrueSchemaForm);

app.mount("#app");

组件使用

<script setup>
import { ref } from "vue";
import {
  createSchemaPipeline,
  createInputSchema,
  createSelectSchema,
} from "@charrue/schema-form-next";
const formData =  ref({})
const formSchema = createSchemaPipeline(
  createInputSchema("name", "姓名", {
    "ui-props": {
      style: "width: 220px"
    }
  }),
  createSelectSchema("rank", "等级", {
    enums: ["A", "B", "C"],
  })
)
</script>


<template>
  <charrue-schema-form
    v-model="formData"
    :schema="formSchema"
  ></charrue-schema-form>
</template>

Package Sidebar

Install

npm i @charrue/schema-form-next

Weekly Downloads

18

Version

1.2.1

License

MIT

Unpacked Size

359 kB

Total Files

9

Last publish

Collaborators

  • charrue