Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions examples/sites/demos/apis/time-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,20 @@ export default {
mode: ['pc', 'mobile-first'],
pcDemo: 'vertical-timeline',
mfDemo: ''
},
{
name: 'description',
type: 'string',
defaultValue: '',
desc: {
'zh-CN': '时间线描述',
'en-US': 'Timeline description'
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加上配置项表示整个特性是3.28.0版本添加的哈:meta: {
stable: '3.28.0'
}

mode: ['pc', 'mobile-first'],
mfDemo: '',
meta: {
stable: '3.28.0'
}
}
],
events: [
Expand Down
9 changes: 7 additions & 2 deletions packages/vue/src/timeline-item/src/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@

<div class="tiny-timeline-item__description" ref="description">
<slot name="description" :slot-scope="node">
{{ node.description }}
<span v-if="description !== undefined && description !== null">
{{ description }}
</span>
<span v-else-if="node.description !== undefined && node.description !== null">
{{ node.description }}
</span>
</slot>
<div v-show="nodeIndex === rootProps.active">
<slot name="active-node-desc" :slot-scope="node"></slot>
Expand Down Expand Up @@ -168,7 +173,7 @@ import type { ITimelineItemApi } from '@opentiny/vue-renderless/types/timeline-i

export default defineComponent({
emits: ['click'],
props: [...props, 'node', 'space', 'lineWidth', 'shape', 'autoColorField', 'nodeIndex'],
props: [...props, 'node', 'space', 'lineWidth', 'shape', 'autoColorField', 'nodeIndex', 'description'],
components: {
IconWarn: iconWarn(),
IconClose: iconClose(),
Expand Down
Loading