项目作者: heichong

项目描述 :
vue-sequence-diagram
高级语言: Vue
项目地址: git://github.com/heichong/vue-sequence-diagram.git
创建时间: 2019-05-22T06:02:31Z
项目社区:https://github.com/heichong/vue-sequence-diagram

开源协议:MIT License

下载


vue-sequence-diagram

Sequence Diagram for vue2

This work was inspired from https://github.com/echoma/text_sequence_diagram

效果

Build Setup

  1. npm install vue-sequence-diagram --save

Usage

  1. <template>
  2. <div id="app" style="width:100%;height:90vh;">
  3. <sequence-diagram :data-list="dataList" @line-click="onClick"></sequence-diagram>
  4. </div>
  5. </template>
  6. <script>
  7. import SequenceDiagram from './lib/SequenceDiagram'
  8. export default {
  9. name: 'app',
  10. data () {
  11. return {
  12. dataList: [
  13. {
  14. label: '100ms',
  15. from: 'Conn Server',
  16. to: 'Safe Domain GW',
  17. note: 'new order request',
  18. isDash: 0
  19. },
  20. {
  21. label: '200ms',
  22. from: 'Safe Domain GW',
  23. to: 'Trade Gateway',
  24. note: 'authenticated',
  25. isDash: 0
  26. },
  27. {
  28. label: '300ms',
  29. from: 'Trade Gateway',
  30. to: 'Logic Control',
  31. note: 'internal protocol',
  32. isDash: 0
  33. },
  34. {
  35. label: '400ms',
  36. name: 'Logic Control',
  37. note: 'check param',
  38. isDash: 0
  39. },
  40. {
  41. label: '500ms',
  42. from: 'Logic Control',
  43. to: 'Order Manage',
  44. note: 'add new order',
  45. isDash: 0
  46. },
  47. {
  48. label: '600ms',
  49. from: 'Order Manage',
  50. to: 'Logic Control',
  51. note: 'order created',
  52. isDash: 0
  53. },
  54. {
  55. label: '700ms',
  56. from: 'Logic Control',
  57. to: 'Trade Gateway',
  58. note: 'success response',
  59. isDash: 1
  60. },
  61. {
  62. label: '800ms',
  63. from: 'Trade Gateway',
  64. to: 'Conn Server',
  65. note: 'success response',
  66. isDash: 1
  67. }
  68. ]
  69. }
  70. },
  71. components:{
  72. SequenceDiagram
  73. },
  74. methods:{
  75. onClick(index,data){
  76. alert("您点击了第"+(index+1)+"个")
  77. }
  78. }
  79. }
  80. </script>
  81. <style>
  82. </style>