时间线

v-timeline 在样式上显示时间顺序信息时很有用。

用例

v-timeline 以其最简单的形式显示一条垂直时间线,其中应至少包含一个 v-timeline-item

template


  1. <template>
  2. <v-timeline>
  3. <v-timeline-item>timeline item</v-timeline-item>
  4. <v-timeline-item class="text-right">timeline item</v-timeline-item>
  5. <v-timeline-item>timeline item</v-timeline-item>
  6. </v-timeline>
  7. </template>

Timelines(时间线) - 图1

API

从下面选择您想要的组件,并查看可用的属性、插槽、事件和函数。

Timelines(时间线) - 图2

实战场

template script


  1. <template>
  2. <div>
  3. <v-radio-group row wrap>
  4. <v-switch v-model="alignTop" label="Toggle align-top" class="mx-4"></v-switch>
  5. <v-switch v-model="dense" label="Toggle dense" class="mx-4"></v-switch>
  6. <v-switch v-model="fillDot" label="Toggle fill-dot" class="mx-4"></v-switch>
  7. <v-switch v-model="hideDot" label="Toggle hide-dot" class="mx-4"></v-switch>
  8. <v-switch v-model="icon" label="Toggle icon" class="mx-4"></v-switch>
  9. <v-switch v-model="avatar" label="Toggle avatar" class="mx-4"></v-switch>
  10. <v-switch v-model="iconColor" label="Toggle icon color" class="mx-4"></v-switch>
  11. <v-switch v-model="reverse" label="Toggle reverse" class="mx-4"></v-switch>
  12. <v-switch v-model="left" label="Toggle left" class="mx-4"></v-switch>
  13. <v-switch v-model="right" label="Toggle right" class="mx-4"></v-switch>
  14. <v-switch v-model="small" label="Toggle small" class="mx-4"></v-switch>
  15. </v-radio-group>
  16. <v-timeline
  17. :align-top="alignTop"
  18. :dense="dense"
  19. :reverse="reverse"
  20. >
  21. <v-timeline-item
  22. v-for="n in 3"
  23. :key="n"
  24. :fill-dot="fillDot"
  25. :hide-dot="hideDot"
  26. :icon="icon ? 'mdi-star' : ''"
  27. :icon-color=" iconColor ? 'deep-orange' : ''"
  28. :left="left"
  29. :right="right"
  30. :small="small"
  31. >
  32. <template v-slot:icon>
  33. <v-avatar v-if="avatar">
  34. <img src="http://i.pravatar.cc/64">
  35. </v-avatar>
  36. </template>
  37. <span slot="opposite">Tus eu perfecto</span>
  38. <v-card class="elevation-2">
  39. <v-card-title class="headline">Lorem ipsum</v-card-title>
  40. <v-card-text>
  41. Lorem ipsum dolor sit amet, no nam oblique veritus. Commune scaevola imperdiet nec ut, sed euismod convenire principes at. Est et nobis iisque percipit, an vim zril disputando voluptatibus, vix an salutandi sententiae.
  42. </v-card-text>
  43. </v-card>
  44. </v-timeline-item>
  45. </v-timeline>
  46. </div>
  47. </template>
  1. <script>
  2. export default {
  3. data: () => ({
  4. alignTop: false,
  5. avatar: false,
  6. dense: false,
  7. fillDot: false,
  8. hideDot: false,
  9. icon: false,
  10. iconColor: false,
  11. left: false,
  12. reverse: false,
  13. right: false,
  14. small: false,
  15. }),
  16. }
  17. </script>

Timelines(时间线) - 图3

示例

下面是一些简单到复杂的例子。

小点

small 属性允许多种样式提供独特的设计。

template


  1. <template>
  2. <v-timeline :dense="$vuetify.breakpoint.smAndDown">
  3. <v-timeline-item
  4. color="purple lighten-2"
  5. fill-dot
  6. right
  7. >
  8. <v-card>
  9. <v-card-title class="purple lighten-2">
  10. <v-icon
  11. dark
  12. size="42"
  13. class="mr-4"
  14. >
  15. mdi-magnify
  16. </v-icon>
  17. <h2 class="display-1 white--text font-weight-light">Title 1</h2>
  18. </v-card-title>
  19. <v-container>
  20. <v-row>
  21. <v-col cols="12" md="10">
  22. Lorem ipsum dolor sit amet, no nam oblique veritus. Commune scaevola imperdiet nec ut, sed euismod convenire principes at. Est et nobis iisque percipit.
  23. </v-col>
  24. <v-col
  25. class="hidden-sm-and-down text-right"
  26. md="2"
  27. >
  28. <v-icon size="64">mdi-calendar-text</v-icon>
  29. </v-col>
  30. </v-row>
  31. </v-container>
  32. </v-card>
  33. </v-timeline-item>
  34. <v-timeline-item
  35. color="amber lighten-1"
  36. fill-dot
  37. left
  38. small
  39. >
  40. <v-card>
  41. <v-card-title class="amber lighten-1 justify-end">
  42. <h2 class="display-1 mr-4 white--text font-weight-light">Title 2</h2>
  43. <v-icon
  44. dark
  45. size="42"
  46. >mdi-home-outline</v-icon>
  47. </v-card-title>
  48. <v-container>
  49. <v-row>
  50. <v-col cols="12" md="8">
  51. Lorem ipsum dolor sit amet, no nam oblique veritus. Commune scaevola imperdiet nec ut, sed euismod convenire principes at. Est et nobis iisque percipit.
  52. </v-col>
  53. <v-col cols="12" md="4">
  54. Lorem ipsum dolor sit amet, no nam oblique veritus.
  55. </v-col>
  56. </v-row>
  57. </v-container>
  58. </v-card>
  59. </v-timeline-item>
  60. <v-timeline-item
  61. color="cyan lighten-1"
  62. fill-dot
  63. right
  64. >
  65. <v-card>
  66. <v-card-title class="cyan lighten-1">
  67. <v-icon
  68. class="mr-4"
  69. dark
  70. size="42"
  71. >
  72. mdi-email-outline
  73. </v-icon>
  74. <h2 class="display-1 white--text font-weight-light">Title 3</h2>
  75. </v-card-title>
  76. <v-container>
  77. <v-row>
  78. <v-col
  79. v-for="n in 3"
  80. :key="n"
  81. cols="12"
  82. md="4"
  83. >
  84. Lorem ipsum dolor sit amet, no nam oblique veritus no nam oblique.
  85. </v-col>
  86. </v-row>
  87. </v-container>
  88. </v-card>
  89. </v-timeline-item>
  90. <v-timeline-item
  91. color="red lighten-1"
  92. fill-dot
  93. left
  94. small
  95. >
  96. <v-card>
  97. <v-card-title class="red lighten-1 justify-end">
  98. <h2 class="display-1 mr-4 white--text font-weight-light">Title 4</h2>
  99. <v-icon
  100. dark
  101. size="42"
  102. >
  103. mdi-account-multiple-outline
  104. </v-icon>
  105. </v-card-title>
  106. <v-container>
  107. <v-row>
  108. <v-col class="hidden-sm-and-down" md="2">
  109. <v-icon size="64">mdi-server-network</v-icon>
  110. </v-col>
  111. <v-col cols="12" md="10">
  112. Lorem ipsum dolor sit amet, no nam oblique veritus. Commune scaevola imperdiet nec ut, sed euismod convenire principes at. Est et nobis iisque percipit, an vim zril disputando voluptatibus.
  113. </v-col>
  114. </v-row>
  115. </v-container>
  116. </v-card>
  117. </v-timeline-item>
  118. <v-timeline-item
  119. color="green lighten-1"
  120. fill-dot
  121. right
  122. >
  123. <v-card>
  124. <v-card-title class="green lighten-1">
  125. <v-icon
  126. class="mr-4"
  127. dark
  128. size="42"
  129. >
  130. mdi-phone-in-talk
  131. </v-icon>
  132. <h2 class="display-1 white--text font-weight-light">Title 5</h2>
  133. </v-card-title>
  134. <v-container>
  135. <v-row>
  136. <v-col>
  137. Lorem ipsum dolor sit amet, no nam oblique veritus. Commune scaevola imperdiet nec ut, sed euismod convenire principes at. Est et nobis iisque percipit, an vim zril disputando voluptatibus, vix an salutandi sententiae.
  138. </v-col>
  139. </v-row>
  140. </v-container>
  141. </v-card>
  142. </v-timeline-item>
  143. </v-timeline>
  144. </template>

Timelines(时间线) - 图4

图标点

有条件地使用 v-timeline-item 点内的图标来提供其他上下文。

template script


  1. <template>
  2. <v-timeline align-top :dense="$vuetify.breakpoint.smAndDown">
  3. <v-timeline-item
  4. v-for="(item, i) in items"
  5. :key="i"
  6. :color="item.color"
  7. :icon="item.icon"
  8. fill-dot
  9. >
  10. <v-card
  11. :color="item.color"
  12. dark
  13. >
  14. <v-card-title class="title">Lorem Ipsum Dolor</v-card-title>
  15. <v-card-text class="white text--primary">
  16. <p>Lorem ipsum dolor sit amet, no nam oblique veritus. Commune scaevola imperdiet nec ut, sed euismod convenire principes at. Est et nobis iisque percipit, an vim zril disputando voluptatibus, vix an salutandi sententiae.</p>
  17. <v-btn
  18. :color="item.color"
  19. class="mx-0"
  20. outlined
  21. >
  22. Button
  23. </v-btn>
  24. </v-card-text>
  25. </v-card>
  26. </v-timeline-item>
  27. </v-timeline>
  28. </template>
  1. <script>
  2. export default {
  3. data: () => ({
  4. items: [
  5. {
  6. color: 'red lighten-2',
  7. icon: 'mdi-star',
  8. },
  9. {
  10. color: 'purple darken-1',
  11. icon: 'mdi-book-variant',
  12. },
  13. {
  14. color: 'green lighten-1',
  15. icon: 'mdi-airballoon',
  16. },
  17. {
  18. color: 'indigo',
  19. icon: 'mdi-buffer',
  20. },
  21. ],
  22. }),
  23. }
  24. </script>

Timelines(时间线) - 图5

反向方向

您可以使用 reverse 属性来反转时间轴项目的方向。这在默认和 dense 模式下都能工作。

template script


  1. <template>
  2. <div>
  3. <v-switch v-model="reverse" label="Toggle reverse"></v-switch>
  4. <v-timeline :reverse="reverse" :dense="$vuetify.breakpoint.smAndDown">
  5. <v-timeline-item
  6. v-for="n in 2"
  7. :key="n"
  8. >
  9. <span slot="opposite">Tus eu perfecto</span>
  10. <v-card class="elevation-2">
  11. <v-card-title class="headline">Lorem ipsum</v-card-title>
  12. <v-card-text>
  13. Lorem ipsum dolor sit amet, no nam oblique veritus. Commune scaevola imperdiet nec ut, sed euismod convenire principes at. Est et nobis iisque percipit, an vim zril disputando voluptatibus, vix an salutandi sententiae.
  14. </v-card-text>
  15. </v-card>
  16. </v-timeline-item>
  17. </v-timeline>
  18. <v-timeline :reverse="reverse" dense>
  19. <v-timeline-item
  20. v-for="n in 2"
  21. :key="n"
  22. >
  23. <span slot="opposite">Tus eu perfecto</span>
  24. <v-card class="elevation-2">
  25. <v-card-title class="headline">Lorem ipsum</v-card-title>
  26. <v-card-text>
  27. Lorem ipsum dolor sit amet, no nam oblique veritus. Commune scaevola imperdiet nec ut, sed euismod convenire principes at. Est et nobis iisque percipit, an vim zril disputando voluptatibus, vix an salutandi sententiae.
  28. </v-card-text>
  29. </v-card>
  30. </v-timeline-item>
  31. </v-timeline>
  32. </div>
  33. </template>
  1. <script>
  2. export default {
  3. data: () => ({
  4. reverse: true,
  5. }),
  6. }
  7. </script>

Timelines(时间线) - 图6

时间线卡片

如果将 v-card 放置在 v-timeline-item 的内部,则插入符会出现在卡的侧面。

template


  1. <template>
  2. <v-timeline>
  3. <v-timeline-item
  4. v-for="n in 3"
  5. :key="n"
  6. color="red lighten-2"
  7. large
  8. >
  9. <template v-slot:opposite>
  10. <span>Tus eu perfecto</span>
  11. </template>
  12. <v-card class="elevation-2">
  13. <v-card-title class="headline">Lorem ipsum</v-card-title>
  14. <v-card-text>
  15. Lorem ipsum dolor sit amet, no nam oblique veritus. Commune scaevola imperdiet nec ut, sed euismod convenire principes at. Est et nobis iisque percipit, an vim zril disputando voluptatibus, vix an salutandi sententiae.
  16. </v-card-text>
  17. </v-card>
  18. </v-timeline-item>
  19. </v-timeline>
  20. </template>

Timelines(时间线) - 图7

密度提示框

dense 时间线将所有内容定位在右侧。 在此示例中,v-alert 替换了卡片以提供不同的设计。

template script


  1. <template>
  2. <v-card
  3. class="mx-auto"
  4. max-width="600"
  5. >
  6. <v-card-title
  7. class="blue-grey white--text"
  8. >
  9. <span class="title">Logs</span>
  10. <v-spacer></v-spacer>
  11. <v-btn
  12. :outlined="interval == null"
  13. :color="interval == null ? 'white' : 'primary'"
  14. dark
  15. depressed
  16. @click="interval == null ? start() : stop()"
  17. >
  18. Realtime Logging
  19. </v-btn>
  20. </v-card-title>
  21. <v-card-text class="py-0">
  22. <v-timeline dense>
  23. <v-slide-x-reverse-transition
  24. group
  25. hide-on-leave
  26. >
  27. <v-timeline-item
  28. v-for="item in items"
  29. :key="item.id"
  30. :color="item.color"
  31. small
  32. fill-dot
  33. >
  34. <v-alert
  35. :value="true"
  36. :color="item.color"
  37. :icon="item.icon"
  38. class="white--text"
  39. >
  40. Lorem ipsum dolor sit amet, no nam oblique veritus. Commune scaevola imperdiet nec ut, sed euismod convenire principes at. Est et nobis iisque percipit, an vim zril disputando voluptatibus, vix an salutandi sententiae.
  41. </v-alert>
  42. </v-timeline-item>
  43. </v-slide-x-reverse-transition>
  44. </v-timeline>
  45. </v-card-text>
  46. </v-card>
  47. </template>
  1. <script>
  2. const COLORS = [
  3. 'info',
  4. 'warning',
  5. 'error',
  6. 'success',
  7. ]
  8. const ICONS = {
  9. info: 'mdi-information',
  10. warning: 'mdi-alert',
  11. error: 'mdi-alert-circle',
  12. success: 'mdi-check-circle',
  13. }
  14. export default {
  15. data: () => ({
  16. interval: null,
  17. items: [
  18. {
  19. id: 1,
  20. color: 'info',
  21. icon: ICONS['info'],
  22. },
  23. ],
  24. nonce: 2,
  25. }),
  26. beforeDestroy () {
  27. this.stop()
  28. },
  29. methods: {
  30. addEvent () {
  31. let { color, icon } = this.genAlert()
  32. const previousColor = this.items[0].color
  33. while (previousColor === color) {
  34. color = this.genColor()
  35. }
  36. this.items.unshift({
  37. id: this.nonce++,
  38. color,
  39. icon,
  40. })
  41. if (this.nonce > 6) {
  42. this.items.pop()
  43. }
  44. },
  45. genAlert () {
  46. const color = this.genColor()
  47. return {
  48. color,
  49. icon: this.genIcon(color),
  50. }
  51. },
  52. genColor () {
  53. return COLORS[Math.floor(Math.random() * 3)]
  54. },
  55. genIcon (color) {
  56. return ICONS[color]
  57. },
  58. start () {
  59. this.interval = setInterval(this.addEvent, 3000)
  60. },
  61. stop () {
  62. clearInterval(this.interval)
  63. this.interval = null
  64. },
  65. },
  66. }
  67. </script>

Timelines(时间线) - 图8

Vuetify Epic Backpack

The Vuetify Epic Backpack is a premium backpack that has a spot for everything you travel with.

ads by Vuetify

](https://store.vuetifyjs.com/product/vuetify-epic-backpack?ref=vuetifyjs.com)

相反的插槽

opposite 插槽在您的时间线内提供额外的自定义层。

template script


  1. <template>
  2. <v-timeline>
  3. <v-timeline-item
  4. v-for="(year, i) in years"
  5. :key="i"
  6. :color="year.color"
  7. small
  8. >
  9. <template v-slot:opposite>
  10. <span
  11. :class="`headline font-weight-bold ${year.color}--text`"
  12. v-text="year.year"
  13. ></span>
  14. </template>
  15. <div class="py-4">
  16. <h2 :class="`headline font-weight-light mb-4 ${year.color}--text`">Lorem ipsum</h2>
  17. <div>
  18. Lorem ipsum dolor sit amet, no nam oblique veritus. Commune scaevola imperdiet nec ut, sed euismod convenire principes at. Est et nobis iisque percipit, an vim zril disputando voluptatibus, vix an salutandi sententiae.
  19. </div>
  20. </div>
  21. </v-timeline-item>
  22. </v-timeline>
  23. </template>
  1. <script>
  2. export default {
  3. data: () => ({
  4. years: [
  5. {
  6. color: 'cyan',
  7. year: '1960',
  8. },
  9. {
  10. color: 'green',
  11. year: '1970',
  12. },
  13. {
  14. color: 'pink',
  15. year: '1980',
  16. },
  17. {
  18. color: 'amber',
  19. year: '1990',
  20. },
  21. {
  22. color: 'orange',
  23. year: '2000',
  24. },
  25. ],
  26. }),
  27. }
  28. </script>

Timelines(时间线) - 图9

头像点

使用 icon 插槽和 v-avatar,将头像插入点中。

template


  1. <template>
  2. <v-timeline>
  3. <v-timeline-item
  4. v-for="n in 4"
  5. :key="n"
  6. large
  7. >
  8. <template v-slot:icon>
  9. <v-avatar>
  10. <img src="http://i.pravatar.cc/64">
  11. </v-avatar>
  12. </template>
  13. <template v-slot:opposite>
  14. <span>Tus eu perfecto</span>
  15. </template>
  16. <v-card class="elevation-2">
  17. <v-card-title class="headline">Lorem ipsum</v-card-title>
  18. <v-card-text>Lorem ipsum dolor sit amet, no nam oblique veritus. Commune scaevola imperdiet nec ut, sed euismod convenire principes at. Est et nobis iisque percipit, an vim zril disputando voluptatibus, vix an salutandi sententiae.</v-card-text>
  19. </v-card>
  20. </v-timeline-item>
  21. </v-timeline>
  22. </template>

Timelines(时间线) - 图10

彩色点

彩色的点可以创建可视的断点,使您的时间线更容易阅读。

template


  1. <template>
  2. <v-card
  3. class="mx-auto"
  4. max-width="400"
  5. >
  6. <v-card
  7. dark
  8. flat
  9. >
  10. <v-btn
  11. absolute
  12. bottom
  13. color="pink"
  14. right
  15. fab
  16. >
  17. <v-icon>mdi-plus</v-icon>
  18. </v-btn>
  19. <v-card-title class="pa-2 purple lighten-3">
  20. <v-btn icon>
  21. <v-icon>mdi-menu</v-icon>
  22. </v-btn>
  23. <h3 class="title font-weight-light text-center grow">Timeline</h3>
  24. <v-avatar>
  25. <v-img src="https://avataaars.io/?avatarStyle=Circle&topType=LongHairStraight&accessoriesType=Blank&hairColor=BrownDark&facialHairType=Blank&clotheType=BlazerShirt&eyeType=Default&eyebrowType=Default&mouthType=Default&skinColor=Light"></v-img>
  26. </v-avatar>
  27. </v-card-title>
  28. <v-img
  29. src="https://cdn.vuetifyjs.com/images/cards/forest.jpg"
  30. gradient="to top, rgba(0,0,0,.44), rgba(0,0,0,.44)"
  31. >
  32. <v-container class="fill-height">
  33. <v-row align="center">
  34. <strong class="display-4 font-weight-regular mr-6">8</strong>
  35. <v-row justify="end">
  36. <div class="headline font-weight-light">Monday</div>
  37. <div class="text-uppercase font-weight-light">February 2015</div>
  38. </v-row>
  39. </v-row>
  40. </v-container>
  41. </v-img>
  42. </v-card>
  43. <v-card-text class="py-0">
  44. <v-timeline
  45. align-top
  46. dense
  47. >
  48. <v-timeline-item
  49. color="pink"
  50. small
  51. >
  52. <v-row class="pt-1">
  53. <v-col cols="3">
  54. <strong>5pm</strong>
  55. </v-col>
  56. <v-col>
  57. <strong>New Icon</strong>
  58. <div class="caption">Mobile App</div>
  59. </v-col>
  60. </v-row>
  61. </v-timeline-item>
  62. <v-timeline-item
  63. color="teal lighten-3"
  64. small
  65. >
  66. <v-row class="pt-1">
  67. <v-col cols="3">
  68. <strong>3-4pm</strong>
  69. </v-col>
  70. <v-col>
  71. <strong>Design Stand Up</strong>
  72. <div class="caption mb-2">Hangouts</div>
  73. <v-avatar>
  74. <v-img
  75. src="https://avataaars.io/?avatarStyle=Circle&topType=LongHairFrida&accessoriesType=Kurt&hairColor=Red&facialHairType=BeardLight&facialHairColor=BrownDark&clotheType=GraphicShirt&clotheColor=Gray01&graphicType=Skull&eyeType=Wink&eyebrowType=RaisedExcitedNatural&mouthType=Disbelief&skinColor=Brown"
  76. ></v-img>
  77. </v-avatar>
  78. <v-avatar>
  79. <v-img
  80. src="https://avataaars.io/?avatarStyle=Circle&topType=ShortHairFrizzle&accessoriesType=Prescription02&hairColor=Black&facialHairType=MoustacheMagnum&facialHairColor=BrownDark&clotheType=BlazerSweater&clotheColor=Black&eyeType=Default&eyebrowType=FlatNatural&mouthType=Default&skinColor=Tanned"
  81. ></v-img>
  82. </v-avatar>
  83. <v-avatar>
  84. <v-img
  85. src="https://avataaars.io/?avatarStyle=Circle&topType=LongHairMiaWallace&accessoriesType=Sunglasses&hairColor=BlondeGolden&facialHairType=Blank&clotheType=BlazerSweater&eyeType=Surprised&eyebrowType=RaisedExcited&mouthType=Smile&skinColor=Pale"
  86. ></v-img>
  87. </v-avatar>
  88. </v-col>
  89. </v-row>
  90. </v-timeline-item>
  91. <v-timeline-item
  92. color="pink"
  93. small
  94. >
  95. <v-row class="pt-1">
  96. <v-col cols="3">
  97. <strong>12pm</strong>
  98. </v-col>
  99. <v-col>
  100. <strong>Lunch break</strong>
  101. </v-col>
  102. </v-row>
  103. </v-timeline-item>
  104. <v-timeline-item
  105. color="teal lighten-3"
  106. small
  107. >
  108. <v-row class="pt-1">
  109. <v-col cols="3">
  110. <strong>9-11am</strong>
  111. </v-col>
  112. <v-col>
  113. <strong>Finish Home Screen</strong>
  114. <div class="caption">Web App</div>
  115. </v-col>
  116. </v-row>
  117. </v-timeline-item>
  118. </v-timeline>
  119. </v-card-text>
  120. </v-card>
  121. </template>

Timelines(时间线) - 图11

高级版

模块化组件允许您创建高度定制的解决方案。

template script


  1. <template>
  2. <v-container style="max-width: 600px;">
  3. <v-timeline dense clipped>
  4. <v-timeline-item
  5. fill-dot
  6. class="white--text mb-12"
  7. color="orange"
  8. large
  9. >
  10. <template v-slot:icon>
  11. <span>JL</span>
  12. </template>
  13. <v-text-field
  14. v-model="input"
  15. hide-details
  16. flat
  17. label="Leave a comment..."
  18. solo
  19. @keydown.enter="comment"
  20. >
  21. <template v-slot:append>
  22. <v-btn
  23. class="mx-0"
  24. depressed
  25. @click="comment"
  26. >
  27. Post
  28. </v-btn>
  29. </template>
  30. </v-text-field>
  31. </v-timeline-item>
  32. <v-slide-x-transition
  33. group
  34. >
  35. <v-timeline-item
  36. v-for="event in timeline"
  37. :key="event.id"
  38. class="mb-4"
  39. color="pink"
  40. small
  41. >
  42. <v-row justify="space-between">
  43. <v-col cols="7" v-text="event.text"></v-col>
  44. <v-col class="text-right" cols="5" v-text="event.time"></v-col>
  45. </v-row>
  46. </v-timeline-item>
  47. </v-slide-x-transition>
  48. <v-timeline-item
  49. class="mb-6"
  50. hide-dot
  51. >
  52. <span>TODAY</span>
  53. </v-timeline-item>
  54. <v-timeline-item
  55. class="mb-4"
  56. color="grey"
  57. icon-color="grey lighten-2"
  58. small
  59. >
  60. <v-row justify="space-between">
  61. <v-col cols="7">This order was archived.</v-col>
  62. <v-col class="text-right" cols="5">15:26 EDT</v-col>
  63. </v-row>
  64. </v-timeline-item>
  65. <v-timeline-item
  66. class="mb-4"
  67. small
  68. >
  69. <v-row justify="space-between">
  70. <v-col cols="7">
  71. <v-chip
  72. class="white--text ml-0"
  73. color="purple"
  74. label
  75. small
  76. >
  77. APP
  78. </v-chip>
  79. Digital Downloads fulfilled 1 item.
  80. </v-col>
  81. <v-col class="text-right" cols="5">15:25 EDT</v-col>
  82. </v-row>
  83. </v-timeline-item>
  84. <v-timeline-item
  85. class="mb-4"
  86. color="grey"
  87. small
  88. >
  89. <v-row justify="space-between">
  90. <v-col cols="7">
  91. Order confirmation email was sent to John Leider (john@vuetifyjs.com).
  92. </v-col>
  93. <v-col class="text-right" cols="5">15:25 EDT</v-col>
  94. </v-row>
  95. </v-timeline-item>
  96. <v-timeline-item
  97. class="mb-4"
  98. hide-dot
  99. >
  100. <v-btn
  101. class="mx-0"
  102. color="white"
  103. >
  104. Resend Email
  105. </v-btn>
  106. </v-timeline-item>
  107. <v-timeline-item
  108. class="mb-4"
  109. color="grey"
  110. small
  111. >
  112. <v-row justify="space-between">
  113. <v-col cols="7">
  114. A $15.00 USD payment was processed on PayPal Express Checkout
  115. </v-col>
  116. <v-col class="text-right" cols="5">15:25 EDT</v-col>
  117. </v-row>
  118. </v-timeline-item>
  119. <v-timeline-item
  120. color="grey"
  121. small
  122. >
  123. <v-row justify="space-between">
  124. <v-col cols="7">
  125. John Leider placed this order on Online Store (checkout #1937432132572).
  126. </v-col>
  127. <v-col class="text-right" cols="5">15:25 EDT</v-col>
  128. </v-row>
  129. </v-timeline-item>
  130. </v-timeline>
  131. </v-container>
  132. </template>
  1. <script>
  2. export default {
  3. data: () => ({
  4. events: [],
  5. input: null,
  6. nonce: 0,
  7. }),
  8. computed: {
  9. timeline () {
  10. return this.events.slice().reverse()
  11. },
  12. },
  13. methods: {
  14. comment () {
  15. const time = (new Date()).toTimeString()
  16. this.events.push({
  17. id: this.nonce++,
  18. text: this.input,
  19. time: time.replace(/:\d{2}\sGMT-\d{4}\s\((.*)\)/, (match, contents, offset) => {
  20. return ` ${contents.split(' ').map(v => v.charAt(0)).join('')}`
  21. }),
  22. })
  23. this.input = null
  24. },
  25. },
  26. }
  27. </script>

Timelines(时间线) - 图12