- 选中节点node: {{ currentNode.node }} + 选中节点 index: {{ currentNode.index }}
+ 选中节点 node: {{ currentNode.node }}
默认内容位于序号下方
-设置textPosition
为right
时, 内容位于序号右边。
使用 tiny-time-line
标签时显示为单链型步骤条,通过 data
属性绑定节点数据, active
属性指定当前选中节点。
When using tiny-time-line
tags, it displays as a chain steps.The node data is bound through the data
attribute, and the active
property specifies the currently selected node.
使用 space
属性配置步骤条节点的宽度。
Use the tiny-time-line
tag and set type
to normal
to implement common steps.
使用 tiny-steps
标签时,显示为条形步骤条。
tiny-steps<
tags, it displays as a bar steps.'
},
- 'codeFiles': ['space.vue']
+ 'codeFiles': ['advanced-steps.vue']
},
{
- 'demoId': 'normal-steps',
- 'name': { 'zh-CN': '普通步骤条', 'en-US': 'Advanced Wizard' },
+ 'demoId': 'vertical-steps',
+ 'name': { 'zh-CN': '竖式步骤条', 'en-US': 'Vertical steps' },
'desc': {
- 'zh-CN':
- '使用 tiny-time-line
标签,并设置 type
为 normal
实现普通步骤条。
Set type
to advanced
to enable the advanced wizard function.
使用 vertical
属性设置为条形步骤条。
vertical<
attribute to set vertical steps.'
},
- 'codeFiles': ['normal-steps.vue']
+ 'codeFiles': ['vertical-steps.vue']
+ },
+ {
+ 'demoId': 'space',
+ 'name': { 'zh-CN': '节点宽度', 'en-US': 'Common Step Bar' },
+ 'desc': {
+ 'zh-CN': '使用 space
属性配置步骤条节点的宽度。
Using space
attribute to set node width.
通过单个节点数据的disabled
属性配置是否禁用;通过 error
属性配置错误状态
通过单个节点数据中的 disabled
属性配置是否禁用;error
属性配置错误状态
Use the tiny-time-line
tag and set type
to timeline
to implement the timeline step bar. If the vertical
attribute is configured, the timeline step bar changes to the vertical mode. If the reverse
attribute is configured, the timeline step bar changes to the vertical mode.
The disabled
attribute in single node data is used to configure whether to disable, while the error
attribute is used to configure error state
通过textPosition
配置节点内容位置,默认位于序号下方, 取值为"right"
时内容位于序号右边。
通过 text-position
配置节点名称位置,默认位于序号下方, 当取值为 right
时名称位于序号右侧。
By default, the subobjects of bound data contain the name, count, and status fields. \nname-field
: Set the field name corresponding to the name in the node information. The default value is'name'. \ncount-field
: field name corresponding to the logo count in the advanced wizard. The default value is'count'. \nstatus-field
: field name corresponding to the data status. The default value is status.
Configure the position of the node name using text-position
, with the default position being below the number. When the value is right
, the name is positioned to the right of the number.
通过show-divider
设置是否显示步骤条底部分隔线,仅当节点文本内容位于序号右边时生效。
The Steps component is used to simulate the order process.
\n' + '通过 show-divider
属性设置是否显示步骤条底部分隔线,仅当节点文本内容位于序号右边时生效。
show-divider
attribute is used to set whether to display the bottom dividing line of the step bar. It only takes effect when the node text content is located to the right of the number.
通过description
插槽添加单个节点的补充描述信息。
The click
event is triggered when a node is clicked.
通过 description
插槽添加单个节点的描述信息。
Add description information for a single node through the description
slot.
通过active-node-desc
插槽添加当前节点一些自定义的描述信息。
The click
event is triggered when a node is clicked.
通过 active-node-desc
插槽添加当前选中节点的描述信息。
Add description information for the active node through the active-node-desc
slot.
通过 size
设置步骤条尺寸。
Customize the content of the step bar node through the scope slot item
.
通过 size
属性设置步骤条尺寸。
Set size of steps through size
attribute.
设置 type
为 advanced
启用高级向导功能。
使用 tiny-time-line
标签,并设置 type
为 timeline
实现时间线步骤条。同时若配置 vertical
属性,时间线步骤条将变成竖向模式,而若再配置 reverse
属性,则还可以实现时间线步骤条竖向模式的反向形式。
默认情况下,绑定数据的子对象包含 name、count 字段。\nname-field
:设置节点信息中名称对应的字段名,默认为 'name' 。\ncount-field
:设置高级向导里徽标计数对应的字段名,默认为 'count' 。\nstatus-field
:设置数据状态对应的字段名,默认为 'status' 。
可以通过以下属性自定义数据项字段:name-field
: 设置节点信息中名称对应的字段名,默认为 'name' count-field
:设置条形步骤条里徽标计数对应的字段名,默认为 'count' 。status-field
:设置数据状态对应的字段名,默认为 'status' 。
name-field
: Set the field name corresponding to the name in the node information, the default is 'name'.count-field
Set the field name corresponding to the count in the logo counter of the bar step bar, the default is 'count'.status-field
: Set the field name corresponding to the status in the data item, the default is 'status'."
},
'codeFiles': ['custom-steps-item.vue']
},
{
'demoId': 'only-number',
- 'name': { 'zh-CN': '序号仅显示数字', 'en-US': '' },
+ 'name': { 'zh-CN': '纯数字序号', 'en-US': 'Only numeric order' },
'desc': {
'zh-CN':
- "设置only-number
为true时,节点只显示数字序号而不显示任何状态图标。
设置 only-number
为true时,节点只显示数字序号而不显示任何状态图标,仅适用单链型步骤条。
only-number
to true, the node only displays numeric serial numbers without any status icons, only applicable to chain steps.'
},
'codeFiles': ['only-number.vue']
},
- {
- 'demoId': 'order-progress',
- 'name': { 'zh-CN': '订单流程', 'en-US': '' },
- 'desc': { 'zh-CN': '通过 Steps 组件模拟订单流程。
\n', 'en-US': '' }, - 'codeFiles': ['order-progress.vue'] - }, { 'demoId': 'click', 'name': { 'zh-CN': '点击事件', 'en-US': '' }, - 'desc': { 'zh-CN': '点击节点时触发 click
事件。
点击节点时触发 click
事件。
click
event when clicking on a node.'
+ },
'codeFiles': ['click.vue']
},
{
- 'demoId': 'slot',
- 'name': { 'zh-CN': '插槽的使用', 'en-US': '' },
- 'desc': { 'zh-CN': '通过作用域插槽 item
自定义步骤条节点内容。
通过插槽 item
自定义节点内容。
item
.'
+ },
+ 'codeFiles': ['slot-item.vue']
}
],
apis: [
@@ -152,8 +152,8 @@ export default {
'type': 'number',
'defaultValue': '-1',
'desc': {
- 'zh-CN': '设置步骤条的选中步骤,默认为-1 。',
- 'en-US': 'Set the selected step of the step bar. The default value is -1.'
+ 'zh-CN': '当前步骤索引,从0开始计数',
+ 'en-US': 'Current step index and count from 0'
},
'demoId': 'advanced-steps'
},
@@ -162,36 +162,72 @@ export default {
'type': 'string',
'defaultValue': 'count',
'desc': {
- 'zh-CN': "设置高级向导里徽标计数对应的字段名,默认为 'count'",
- 'en-US':
- "Set the field name corresponding to the logo count in the advanced wizard. The default value is'count'"
+ 'zh-CN': '条形步骤条里徽标计数对应的字段名',
+ 'en-US': 'Custom field name corresponding to logo count in bar steps'
},
'demoId': 'custom-steps-item'
},
{
'name': 'data',
- 'type': 'object , Array',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置步骤条的数据。', 'en-US': 'Set the step bar data.' },
- 'demoId': 'data-resource'
+ 'type': 'IStepsItem',
+ 'typeAnchorName': 'IStepsItem[] | ITimelineItem[]',
+ 'defaultValue': '[]',
+ 'desc': {
+ 'zh-CN':
+ '步骤条数据,其中条形步骤条的数据类型参考IStepsItem;单链型步骤条的数据类型参考Timeline组件',
+ 'en-US':
+ 'The data type of the step bar is referred to IStepsItem, and the data type of the chain step bar is referred to Timeline component.'
+ },
+ 'demoId': 'normal-steps'
},
{
'name': 'name-field',
'type': 'string',
'defaultValue': 'name',
'desc': {
- 'zh-CN': "设置节点信息中名称对应的字段名,默认为 'name'",
- 'en-US': "Set the field name corresponding to the name in the node information. The default value is'name'"
+ 'zh-CN': '节点名称对应的字段名',
+ 'en-US': 'Field name corresponds to name of node'
},
'demoId': 'custom-steps-item'
},
+ {
+ 'name': 'only-number',
+ 'type': 'boolean',
+ 'defaultValue': 'false',
+ 'desc': {
+ 'zh-CN': '节点序号是否只显示数字,用于单链型步骤条',
+ 'en-US': 'Whether the node sequence number only displays numbers, used for chain steps'
+ },
+ 'demoId': 'only-number'
+ },
+ {
+ 'name': 'reverse',
+ 'type': 'boolean',
+ 'defaultValue': 'false',
+ 'desc': {
+ 'zh-CN': '是否逆序展示数据,用于单链型步骤条',
+ 'en-US': 'Whether to display data in reverse order, used for chain steps'
+ },
+ 'demoId': 'vertical-steps'
+ },
+ {
+ 'name': 'show-divider',
+ 'type': 'boolean',
+ 'defaultValue': 'false',
+ 'desc': {
+ 'zh-CN': '是否显示单链型步骤条的底部分割线',
+ 'en-US': 'Whether to display the bottom separator line of the chain steps'
+ },
+ 'demoId': 'show-divider'
+ },
{
'name': 'space',
- 'type': 'string, number',
+ 'type': 'string | number',
'defaultValue': '',
'desc': {
- 'zh-CN': '设置步骤条节点的宽度, 取值为数字、带长度单位数值与百分比,数字会默认以px为长度单位。',
- 'en-US': 'Set the width of the step bar.'
+ 'zh-CN': '节点宽度, 可取值数字、带长度单位数值与百分比,传数字则默认以 px 为长度单位。',
+ 'en-US':
+ 'Node width can be set to numeric values, values with length units, or percentages. Numeric values will default to using pixels as the length unit'
},
'demoId': 'space'
},
@@ -200,8 +236,8 @@ export default {
'type': 'string',
'defaultValue': 'status',
'desc': {
- 'zh-CN': "设置数据状态对应的字段名,默认为 'status'",
- 'en-US': "Name of the field corresponding to the data status. The default value is'status'"
+ 'zh-CN': '数据状态对应的字段名,用于条形步骤条',
+ 'en-US': 'Field name corresponding to data status, used for bar steps '
},
'demoId': 'custom-steps-item'
},
@@ -209,31 +245,20 @@ export default {
'name': 'text-position',
'type': 'string',
'defaultValue': 'bottom',
- 'desc': { 'zh-CN': '设置节点文本内容的位置, 可选值有right, bottom', 'en-US': '' },
+ 'desc': {
+ 'zh-CN': '节点名称的位置, 可选值有right | bottom,用于单链型步骤条',
+ 'en-US':
+ 'The position of the node name, with optional values of right | bottom, is used for the chain steps'
+ },
'demoId': 'text-position'
- },
- {
- 'name': 'show-divider',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '设置是否显示步骤条底部分割线', 'en-US': '' },
- 'demoId': 'show-divider'
- },
- {
- 'name': 'only-number',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '节点序号是否只显示数字', 'en-US': '' },
- 'demoId': 'only-number'
- },
+ }
],
'events': [
{
'name': 'click',
- 'type': '',
- 'defaultValue': '',
+ 'type': '(index: number, node: IStepsItem | ITimelineItem) => void',
'desc': {
- 'zh-CN': '节点的点击事件,参数(index:节点索引, node:节点数据信息)',
+ 'zh-CN': '节点点击事件,参数: