Files
my-v0-server/app/resources/materials/text.json
T

214 lines
4.7 KiB
JSON

{
"order": 16,
"key": "text",
"type": "text",
"name": "文本",
"description": "显示一段文字,常用作大屏标题、说明或标签",
"tags": [
"info",
"文本",
"text"
],
"renderer": "text",
"group": "info",
"icon": "solar:text-bold",
"sample_data": false,
"usage_notes": [
"events 中代码只作为资料保存,不由后端执行"
],
"field_groups": [
"node-base",
{
"key": "text-content",
"label": "内容",
"description": "文本组件显示的文字",
"fields": [
{
"path": "props.content",
"label": "内容",
"description": "文本组件显示的文字",
"value_type": "string",
"aliases": [
"文字",
"文本内容",
"标题文字",
"名字"
]
}
]
},
{
"key": "text-style",
"label": "文字样式",
"description": "文字的颜色、大小、粗细和对齐",
"fields": [
{
"path": "style.color",
"label": "颜色",
"description": "文字的颜色",
"value_type": "color",
"aliases": [
"文字颜色",
"字体颜色"
]
},
{
"path": "style.fontSize",
"label": "字号",
"description": "文字的大小",
"value_type": "number",
"minimum": 8,
"maximum": 200,
"unit": "px",
"aliases": [
"字体大小",
"文字大小"
]
},
{
"path": "style.textAlign",
"label": "水平对齐",
"description": "文字在组件内的水平位置",
"value_type": "enum",
"options": [
{
"value": "left",
"label": "左对齐"
},
{
"value": "center",
"label": "居中"
},
{
"value": "right",
"label": "右对齐"
}
],
"aliases": [
"对齐"
]
},
{
"path": "style.alignItems",
"label": "垂直对齐",
"description": "文字在组件内的垂直位置",
"value_type": "enum",
"options": [
{
"value": "flex-start",
"label": "顶部"
},
{
"value": "center",
"label": "居中"
},
{
"value": "flex-end",
"label": "底部"
}
]
},
{
"path": "style.fontWeight",
"label": "字重",
"description": "文字粗细",
"value_type": "enum",
"default": "normal",
"options": [
{
"value": "normal",
"label": "常规"
},
{
"value": "bold",
"label": "加粗"
}
],
"aliases": [
"加粗",
"粗细"
],
"panel": false
},
{
"path": "style.backgroundColor",
"label": "背景色",
"description": "文本组件的背景颜色,默认透明",
"value_type": "color",
"default": "transparent",
"aliases": [
"背景颜色",
"底色"
],
"panel": false
}
]
}
],
"eventOptions": [
{
"label": "点击事件",
"value": "click"
},
{
"label": "双击事件",
"value": "dblclick"
},
{
"label": "鼠标进入事件",
"value": "mouseenter"
},
{
"label": "鼠标离开事件",
"value": "mouseleave"
},
{
"label": "鼠标按下事件",
"value": "mousedown"
},
{
"label": "鼠标抬起事件",
"value": "mouseup"
},
{
"label": "鼠标移动事件",
"value": "mousemove"
},
{
"label": "鼠标滚轮事件",
"value": "mousewheel"
},
{
"label": "生命周期事件",
"value": "vnodeMounted"
}
],
"schema": {
"type": "text",
"name": "文本",
"layout": {
"x": 0,
"y": 0,
"width": 200,
"height": 50
},
"props": {
"content": "电商运营数据看板"
},
"style": {
"color": "#e5eaf3",
"fontSize": 16,
"textAlign": "center",
"alignItems": "center"
},
"events": [
{
"type": "click",
"title": "点击事件",
"name": "fn",
"code": "console.log(123)"
}
]
}
}