8d709c78e90abfbcb1d8e6a4da0843627bdc1529.svn-base 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <div class="home">
  3. <div class="banner">
  4. <img alt="Vue logo" style="width: 64px; height: 64px" src="../assets/logo.png">
  5. <h3 style="margin-top: 1rem">Welcome to Your Vue.js App</h3>
  6. </div>
  7. <br/>
  8. <h2># Trend 组件 </h2>
  9. <a-divider> 正常 </a-divider>
  10. <a-card>
  11. <trend flag="up" style="margin-right: 16px;">
  12. <span slot="term">工资</span>
  13. 5%
  14. </trend>
  15. <trend flag="up" style="margin-right: 16px;">
  16. <span slot="term">工作量</span>
  17. 50%
  18. </trend>
  19. <trend flag="down">
  20. <span slot="term">身体状态</span>
  21. 50%
  22. </trend>
  23. </a-card>
  24. <a-divider> 颜色反转 </a-divider>
  25. <a-card style="margin-bottom: 3rem">
  26. <trend flag="up" :reverse-color="true" style="margin-right: 16px;">
  27. <span slot="term">工资</span>
  28. 5%
  29. </trend>
  30. <trend flag="down" :reverse-color="true" style="margin-right: 16px;">
  31. <span slot="term">工作量</span>
  32. 50%
  33. </trend>
  34. </a-card>
  35. <h2># AvatarList 组件 </h2>
  36. <a-divider> AvatarList </a-divider>
  37. <a-card style="margin-bottom: 3rem">
  38. <avatar-list :max-length="3">
  39. <avatar-list-item tips="Jake" src="https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png" />
  40. <avatar-list-item tips="Andy" src="https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png" />
  41. <avatar-list-item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" />
  42. <avatar-list-item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" />
  43. <avatar-list-item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" />
  44. <avatar-list-item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" />
  45. <avatar-list-item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" />
  46. </avatar-list>
  47. <a-divider type="vertical" style="margin: 0 16px" />
  48. <avatar-list size="mini">
  49. <avatar-list-item tips="Jake" src="https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png" />
  50. <avatar-list-item tips="Andy" src="https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png" />
  51. <avatar-list-item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" />
  52. </avatar-list>
  53. </a-card>
  54. <h2># CountDown 组件 </h2>
  55. <a-divider> CountDown </a-divider>
  56. <a-card style="margin-bottom: 3rem">
  57. <count-down
  58. style="font-size: 2rem"
  59. :target="new Date().getTime() + 3000000"
  60. :on-end="onEndHandle">
  61. </count-down>
  62. <a-divider type="vertical" style="margin: 0 16px" />
  63. <count-down
  64. style="font-size: 2rem"
  65. :target="new Date().getTime() + 10000"
  66. :on-end="onEndHandle2">
  67. </count-down>
  68. </a-card>
  69. <h2># Ellipsis 组件 </h2>
  70. <a-divider> Ellipsis </a-divider>
  71. <a-card style="margin-bottom: 3rem">
  72. <ellipsis :length="100" tooltip>
  73. There were injuries alleged in three cases in 2015, and a
  74. fourth incident in September, according to the safety recall report. After meeting with US regulators in October, the firm decided to issue a voluntary recall.
  75. </ellipsis>
  76. </a-card>
  77. <h2># NumberInfo 组件 </h2>
  78. <a-divider> NumberInfo </a-divider>
  79. <a-card>
  80. <number-info
  81. :sub-title="() => { return 'Visits this week' }"
  82. :total="12321"
  83. status="up"
  84. :sub-total="17.1"></number-info>
  85. </a-card>
  86. </div>
  87. </template>
  88. <script>
  89. // @ is an alias to /src
  90. import Trend from '@/components/Trend'
  91. import AvatarList from '@/components/AvatarList'
  92. import CountDown from '@/components/CountDown/CountDown'
  93. import Ellipsis from '@/components/Ellipsis'
  94. import NumberInfo from '@/components/NumberInfo'
  95. const AvatarListItem = AvatarList.AvatarItem
  96. export default {
  97. name: 'Home',
  98. components: {
  99. NumberInfo,
  100. Ellipsis,
  101. CountDown,
  102. Trend,
  103. AvatarList,
  104. AvatarListItem
  105. },
  106. data () {
  107. return {
  108. targetTime: new Date().getTime() + 3900000
  109. }
  110. },
  111. methods: {
  112. onEndHandle () {
  113. this.$message.success('CountDown callback!!!')
  114. },
  115. onEndHandle2 () {
  116. this.$notification.open({
  117. message: 'Notification Title',
  118. description: 'This is the content of the notification. This is the content of the notification. This is the content of the notification.',
  119. });
  120. }
  121. }
  122. }
  123. </script>
  124. <style scoped>
  125. .home {
  126. width: 900px;
  127. margin: 0 auto;
  128. padding: 25px 0;
  129. }
  130. .home > .banner {
  131. text-align: center;
  132. padding: 25px 0;
  133. margin: 25px 0;
  134. }
  135. </style>