-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
v_huyilin
committed
Dec 3, 2024
1 parent
be2ee83
commit feb2905
Showing
8 changed files
with
597 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
82 changes: 82 additions & 0 deletions
82
packages/form-design/Right/AttrEdit/StyleConfig/basicSchema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import type { FormSchema } from "@vue-form-craft/types" | ||
|
||
const schema: FormSchema = { | ||
labelWidth: 60, | ||
labelAlign: 'right', | ||
size: 'small', | ||
items: [ | ||
{ | ||
label: 'class', | ||
component: 'Input', | ||
props: { | ||
placeholder: '' | ||
}, | ||
designKey: 'design-KUlI', | ||
name: 'class' | ||
}, | ||
{ | ||
label: '宽度', | ||
component: 'SelectInput', | ||
props: { | ||
selectPosition: 'append', | ||
selectWidth: 50, | ||
selectInitialValue: '%', | ||
placeholder: '100', | ||
options: [ | ||
{ | ||
label: '%', | ||
value: '%' | ||
}, | ||
{ | ||
label: 'px', | ||
value: 'px' | ||
}, | ||
{ | ||
label: 'vw', | ||
value: 'vw' | ||
}, | ||
{ | ||
label: 'rem', | ||
value: 'rem' | ||
} | ||
], | ||
clearable: true | ||
}, | ||
designKey: 'design-Bvi4', | ||
name: 'style.width' | ||
}, | ||
{ | ||
label: '高度', | ||
component: 'SelectInput', | ||
props: { | ||
selectPosition: 'append', | ||
selectWidth: 50, | ||
selectInitialValue: 'px', | ||
placeholder: 'auto', | ||
options: [ | ||
{ | ||
label: '%', | ||
value: '%' | ||
}, | ||
{ | ||
label: 'px', | ||
value: 'px' | ||
}, | ||
{ | ||
label: 'vh', | ||
value: 'vh' | ||
}, | ||
{ | ||
label: 'rem', | ||
value: 'rem' | ||
} | ||
], | ||
clearable: true | ||
}, | ||
designKey: 'design-Bvi44', | ||
name: 'style.height' | ||
} | ||
] | ||
} | ||
|
||
export default schema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<template> | ||
<div :class="ns('style-config')"> | ||
<el-divider>组件样式</el-divider> | ||
<FormRender v-model="currentProps" :schema="basicSchema" ref="formRef" /> | ||
<div class="more"> | ||
<el-button type="primary" plain size="small" @click="visible = true" | ||
>自定义更多样式</el-button | ||
> | ||
</div> | ||
|
||
<el-drawer v-model="visible" title="组件样式"> | ||
<FormRender v-model="currentProps" :schema="schema" ref="formRef" /> | ||
</el-drawer> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
import FormRender from '@vue-form-craft/form-render' | ||
import { ns } from '@vue-form-craft/utils' | ||
import basicSchema from './basicSchema' | ||
import schema from './schema' | ||
const currentProps = defineModel<Record<string, any>>() | ||
const visible = ref(false) | ||
</script> |
Oops, something went wrong.