PluginDetail.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <div id="PluginDetail">
  3. <h2>{{ data.pluginName }}</h2>
  4. <el-divider />
  5. <div class="itemList">
  6. <el-table :data="tableData" style="width: 100%" :show-header="false">
  7. <el-table-column prop="title" label="标题" width="160" className="vertical-align-top">
  8. <template #default="scope">
  9. <span class="title">{{ scope.row.title }}</span>
  10. </template>
  11. </el-table-column>
  12. <el-table-column prop="content" label="内容" >
  13. <template #default="scope">
  14. <pre>{{ scope.row.content }}</pre>
  15. </template>
  16. </el-table-column>
  17. </el-table>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. tableData: []
  26. }
  27. },
  28. props: {
  29. data: Number
  30. },
  31. watch: {
  32. "data": function (params) {
  33. this.renderTable();
  34. }
  35. },
  36. created() {
  37. },
  38. mounted() {
  39. let app = this;
  40. this.renderTable();
  41. },
  42. methods: {
  43. renderTable() {
  44. this.tableData = []
  45. let methods = {
  46. title: '集成方式和步骤:',
  47. content: this.data.methods
  48. }
  49. let params = {
  50. title: '参数说明:',
  51. content: this.data.params
  52. }
  53. let example = {
  54. title: '调用示例:',
  55. content: this.data.example
  56. }
  57. let response = {
  58. title: '返回值示例:',
  59. content: this.data.response
  60. }
  61. let display = {
  62. title: '效果展示:',
  63. content: this.data.display
  64. }
  65. this.tableData.push(methods)
  66. this.tableData.push(params)
  67. this.tableData.push(example)
  68. this.tableData.push(response)
  69. this.tableData.push(display)
  70. }
  71. }
  72. }
  73. </script>
  74. <style scoped>
  75. #PluginDetail {
  76. width: 100%;
  77. height: 100%;
  78. padding-left: 1%;
  79. }
  80. #PluginDetail .itemList {
  81. width: 100%;
  82. }
  83. #PluginDetail .itemList .title {
  84. display: inline-block;
  85. margin-left: 10px;
  86. font-size: 15px;
  87. font-weight: bold;
  88. }
  89. </style>
  90. <style>
  91. .vertical-align-top {
  92. vertical-align: top !important;
  93. }
  94. </style>