更新记录

1.0.0(2026-07-30) 下载此版本

1.0.0

  • schema 配置式渲染,支持 text、number、textarea、select、radio、tags。
  • 支持必填校验,提交时返回 valid / values / errors
  • 支持自定义主题色、标题、副标题、提交按钮和重置按钮。
  • 免费组件,无广告、无数据采集、无特殊权限。

平台兼容性

uni-app(5.07)

Vue2 Vue3 Chrome Safari app-vue app-nvue Android iOS 鸿蒙
- - - - - - - -
微信小程序 支付宝小程序 抖音小程序 百度小程序 快手小程序 京东小程序 鸿蒙元服务 QQ小程序 飞书小程序 小红书小程序 快应用-华为 快应用-联盟
- - - - - - - - -

una-form 表单组件

una-form 是基于 uni-app Vue3 的轻量表单组件,适合快速搭建资料填写、申请发票、联系人信息等移动端表单页面。

特性

  • schema 配置式渲染,支持 text、number、textarea、select、radio、tags。
  • 支持必填校验,提交时返回 valid / values / errors
  • 支持自定义主题色、标题、副标题、提交按钮和重置按钮。
  • 免费组件,无广告、无数据采集、无特殊权限。

基础用法

<template>
    <una-form
        v-model="form"
        title="申请发票"
        :schema="schema"
        themeColor="#2979ff"
        @submit="handleSubmit"
    />
</template>

<script setup>
import { ref } from "vue";

const form = ref({
    type: "company",
    title: "",
    taxNo: ""
});

const schema = [
    {
        key: "type",
        label: "发票类型",
        type: "radio",
        required: true,
        options: [
            { label: "个人", value: "personal" },
            { label: "企业", value: "company" }
        ]
    },
    { key: "title", label: "发票抬头", type: "text", required: true },
    { key: "taxNo", label: "税号", type: "text", required: true }
];

function handleSubmit(event) {
    console.log(event.valid, event.values, event.errors);
}
</script>

Props

参数 说明 类型 默认值
v-model 表单数据对象 Object {}
schema 表单字段配置 Array []
title 表单标题 String ""
subtitle 表单副标题 String ""
themeColor 主题色 String #2979ff
disabled 是否禁用 Boolean false
showActions 是否显示底部按钮 Boolean true
showReset 是否显示重置按钮 Boolean true
submitText 提交按钮文案 String 提交
resetText 重置按钮文案 String 重置

Events

事件 说明
change 单个字段变更时触发
submit 点击提交时触发,返回 { valid, values, errors }
reset 点击重置时触发

Schema 字段

字段 说明
key 字段名,对应 v-model 中的属性
label 表单项标题
type textnumbertextareaselectradiotags
placeholder 占位提示
required 是否必填
message 必填校验失败提示
options select、radio、tags 的选项数组
defaultValue 重置时使用的默认值

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

插件不采集任何数据

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

暂无用户评论。