@koala-form/element-plugin
TypeScript icon, indicating that this package has built-in type declarations

2.0.7 • Public • Published

koala

Koala-Form

低代码表单解决方案,让你跟考拉一样“懒”

GitHub issues MIT PRs Welcome Page Views Count

Install

npm i @koala-form/core
npm i @koala-form/element-plugin

Usage

注册全局插件

import { componentPlugin } '@koala-form/element-plugin';
import { installPluginPreset, installInGlobal } from '@koala-form/core';

// 将依赖的插件安装到全局
installPluginPreset();

installInGlobal(componentPlugin)

写一个简单的表单

<template>
    <KoalaRender :render="render"></KoalaRender>
</template>

<script>
import { KoalaRender, useForm, ComponentType } from '@koala-form/core';

export default {
    components: { KoalaRender },
    setup() {
        const { render } = useForm({
            fields: [
                {
                    name: 'name', // modelRef.value.name可以访问到值
                    label: '姓名', // 表单项的名称
                    defaultValue: '蒙奇·D·路飞', // 默认值
                    components: {
                        name: ComponentType.Input, // 表单组件是输入框
                    },
                },
            ],
        });
        return {
            render
        };
    },
};
</script>

反馈

Readme

Keywords

Package Sidebar

Install

npm i @koala-form/element-plugin

Weekly Downloads

7

Version

2.0.7

License

MIT

Unpacked Size

31.1 kB

Total Files

10

Last publish

Collaborators

  • aring_