增加标题配置,产品分类配置,产品卡片组

main
一杯沧海 12 months ago
parent 7666f0a378
commit 6f5f4d3023
  1. 148
      src/App.vue
  2. 2
      src/engineer/configs/TextConfig.vue
  3. 3
      src/engineer/render.ts
  4. 15
      src/engineer/types.ts

@ -534,6 +534,154 @@ categories.value.unshift({
},
]
}
},
{
title: '产品分类',
vid: hash(`${++nextId}`),
mid: hash(`${++nextId}`),
maxReferenceCount: -1,
referenceCount:0,
image:undefined,
configs:[
{
help: '帮助',
addable: true,
type: 'list',
field: 'items',
label: '产品分类列表',
configs: [
{
type: 'image',
label: '分类图片',
field: 'itemImage',
//
inlines: [{
type: 'text',
field: 'link',
label: '链接',
help: '请输入链接', // "${label}"
},
{
type: 'text',
label: '自定义标题',
field: 'title',
},
]
},
]
},
],
init:{
theme: {
color: '#fff',
},
items:[
{
title: '标题',
link: 'link'
}
]
},
theme:{
padding: 12,
color: '@@theme.color',
},
children:{
theme:{
width: '100%',
clip: 'autoX',
whiteSpace: 'nowrap',
},
children:{
type: 'each',
key: 'items',
handle: {
theme:{
width: '60px',
height: '60px',
display: 'inline-block',
radius: 40,
color: 'pink',
textColor: '#fff',
margin: {
right: 10
},
},
children:'图片',
}
},
}
},
{
title: '两列产品卡片',
vid: hash(`${++nextId}`),
mid: hash(`${++nextId}`),
maxReferenceCount: -1,
referenceCount:0,
image:undefined,
configs:[],
init:{},
theme:{
color: 'pink',
padding:{
top: 12.5,
left:12.5,
right: 12.5
},
gap:10,
},
children:[
{
theme:{
width: 170,
height:200,
color: 'white'
},
children: '产品'
},
{
theme:{
width: 170,
height:200,
color: 'white'
},
children: '产品'
}
]
},
{
title: '自定义标题',
vid: hash( `${++nextId}`),
mid: hash( `${++nextId}`),
maxReferenceCount: -1,
referenceCount:0,
image: undefined,
configs:[
{
type: 'text',
field: 'Title',
label: '标题',
help: '自定义标题', // "${label}"
},
],
init: {
Title:'猜你喜欢',
},
theme:{
padding:{
vertical: 15,
horizontal: 15,
},
color: '#fff',
textColor: '#333',
fontSize: '@@theme.fontSize',
fontWeight: 900,
},
children:{
type: 'text',
key: 'Title'
}
}
],
})

@ -17,7 +17,7 @@ const data = useSource<string>(props.field)
</script>
<template>
<div>
<div style="display: flex;justify-content: space-between">
<label>
<span>{{ label }}</span>
<span v-if="required">*</span>

@ -118,8 +118,11 @@ export function render(
// textual
color: value(theme?.textColor),
fontSize: unit(value(theme?.fontSize)),
fontWeight: value(theme?.fontWeight),
textAlign: value(theme?.textAlign),
lineHeight: value(theme?.lineHeight),
display: value(theme?.display),
whiteSpace: value(theme?.whiteSpace),
// clip
...clip(value(theme?.clip)),
// stack

@ -156,6 +156,8 @@ export interface Textual {
textColor?: string
/** 字体大小 */
fontSize?: number
/** 字体粗细 */
fontWeight?: 400|500|600|700|800|900
/** 文本方向 */
textAlign?: TextAlign
/** 行高,行高比较特殊,需要转换单位 */
@ -210,6 +212,15 @@ export interface Decoration {
gradient?: Gradient
}
/**
*
*
*/
export interface BoxBlock {
display?: 'block' | 'inline-block'
whiteSpace?: 'nowrap' | 'pre'
}
/**
*
*
@ -224,6 +235,8 @@ export interface Spatial {
shrink?: number
}
/**
*
*
@ -281,7 +294,7 @@ export type ClipBehavior =
*
*
*/
export interface Theme extends Textual, Flexible, Boxed, Decoration, Spatial, Flexible, Stacked {
export interface Theme extends Textual, Flexible,BoxBlock, Boxed, Decoration, Spatial, Flexible, Stacked {
/**
*
*

Loading…
Cancel
Save