✨ feat: 更新 Form 组件
This commit is contained in:
parent
1ac9cf8ff5
commit
da4c4ced8f
4 changed files with 12 additions and 7 deletions
6
src/libs/components/Form/index.ts
Normal file
6
src/libs/components/Form/index.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
import FormInput from './form-input.svelte';
|
||||
import FormWrap from './form-wrap.svelte';
|
||||
|
||||
const Form = { Wrap: FormWrap, Input: FormInput };
|
||||
export default Form;
|
||||
export { FormInput, FormWrap };
|
|
@ -2,14 +2,13 @@
|
|||
Copyright (c) 2023 by frostime All Rights Reserved.
|
||||
Author : frostime
|
||||
Date : 2023-07-01 19:23:50
|
||||
FilePath : /src/libs/setting-panel.svelte
|
||||
LastEditTime : 2024-06-08 18:25:34
|
||||
FilePath : /src/libs/components/setting-panel.svelte
|
||||
LastEditTime : 2024-08-09 21:41:07
|
||||
Description :
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import ItemWrap from "./item-wrap.svelte";
|
||||
import InputItem from "./item-input.svelte";
|
||||
import Form from './Form';
|
||||
|
||||
export let group: string;
|
||||
export let settingItems: ISettingItem[];
|
||||
|
@ -31,12 +30,12 @@
|
|||
<div class="config__tab-container {fn__none}" data-name={group}>
|
||||
<slot />
|
||||
{#each settingItems as item (item.key)}
|
||||
<ItemWrap
|
||||
<Form.Wrap
|
||||
title={item.title}
|
||||
description={item.description}
|
||||
direction={item?.direction}
|
||||
>
|
||||
<InputItem
|
||||
<Form.Input
|
||||
type={item.type}
|
||||
key={item.key}
|
||||
bind:value={item.value}
|
||||
|
@ -47,6 +46,6 @@
|
|||
on:click={onClick}
|
||||
on:changed={onChanged}
|
||||
/>
|
||||
</ItemWrap>
|
||||
</Form.Wrap>
|
||||
{/each}
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue