Skip to content

Commit d6ae783

Browse files
authored
fix(timeline): add description prop for configuration mode display Fixes #3070 (#3822)
* fix(timeline): add description prop for configuration mode display * chore(time-line): add meta stable version info for new feature
1 parent 4d488ce commit d6ae783

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

examples/sites/demos/apis/time-line.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,20 @@ export default {
244244
mode: ['pc', 'mobile-first'],
245245
pcDemo: 'vertical-timeline',
246246
mfDemo: ''
247+
},
248+
{
249+
name: 'description',
250+
type: 'string',
251+
defaultValue: '',
252+
desc: {
253+
'zh-CN': '时间线描述',
254+
'en-US': 'Timeline description'
255+
},
256+
mode: ['pc', 'mobile-first'],
257+
mfDemo: '',
258+
meta: {
259+
stable: '3.28.0'
260+
}
247261
}
248262
],
249263
events: [

packages/vue/src/timeline-item/src/pc.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@
5151

5252
<div class="tiny-timeline-item__description" ref="description">
5353
<slot name="description" :slot-scope="node">
54-
{{ node.description }}
54+
<span v-if="description !== undefined && description !== null">
55+
{{ description }}
56+
</span>
57+
<span v-else-if="node.description !== undefined && node.description !== null">
58+
{{ node.description }}
59+
</span>
5560
</slot>
5661
<div v-show="nodeIndex === rootProps.active">
5762
<slot name="active-node-desc" :slot-scope="node"></slot>
@@ -168,7 +173,7 @@ import type { ITimelineItemApi } from '@opentiny/vue-renderless/types/timeline-i
168173
169174
export default defineComponent({
170175
emits: ['click'],
171-
props: [...props, 'node', 'space', 'lineWidth', 'shape', 'autoColorField', 'nodeIndex'],
176+
props: [...props, 'node', 'space', 'lineWidth', 'shape', 'autoColorField', 'nodeIndex', 'description'],
172177
components: {
173178
IconWarn: iconWarn(),
174179
IconClose: iconClose(),

0 commit comments

Comments
 (0)