AppCommet.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <div style="margin-top: 20px; min-height: 100px; background: #FFFFFF;">
  3. <div class="commet-title">
  4. <span><i class="el-icon-edit"></i> 用户评论</span>
  5. </div>
  6. <div class="commet-show">
  7. <el-row :gutter="10">
  8. <el-col :span="18">
  9. <div class="commet-list">
  10. <commet-item v-for="(commet, index) in commets" :key="index" :commet="commet"/>
  11. <span class="no-commet" v-if="!commets || commets.length === 0">暂无评论</span>
  12. </div>
  13. </el-col>
  14. <el-col :span="6">
  15. <div style="commet-submit">
  16. <el-input
  17. type="textarea"
  18. :rows="10"
  19. resize="none"
  20. placeholder="发表评论">
  21. </el-input>
  22. <div style="margin-top: 20px;">
  23. <el-button type="success">发表评论</el-button>
  24. </div>
  25. </div>
  26. </el-col>
  27. </el-row>
  28. </div>
  29. </div>
  30. </template>
  31. <script>
  32. import CommetItem from './CommetItem'
  33. export default {
  34. components: {
  35. CommetItem
  36. },
  37. data () {
  38. return {
  39. commets: [
  40. {
  41. id: 1,
  42. userName: "飞翔的企鹅",
  43. time: "2018-04-03 11:30:35",
  44. icon: "/icon.jpg",
  45. message: "这个应用真好用啊!!!"
  46. },
  47. {
  48. id: 2,
  49. userName: "飞翔的企鹅2",
  50. time: "2018-04-03 11:30:35",
  51. icon: "/icon.jpg",
  52. message: "突然看到首页又有这个软件……居然还没挂……想看这类小说的去起点看如倾如诉的书吧,虽然现在我觉得它的小说有点不合胃口,但是这类小说里他的书是顶尖的。毕竟题材限制,如果只是火影同人的话建议看火影之活久见,还有三千世的三部曲(有很小的腐向但是文笔超好)"
  53. },
  54. {
  55. id: 3,
  56. userName: "我的名字你不懂",
  57. time: "2018-04-03 11:47:26",
  58. icon: "/icon.jpg",
  59. message: "软件用了有一段时间了,能查电费,能交电费,还是很方便的"
  60. },
  61. {
  62. id: 4,
  63. userName: "我的名字你不懂",
  64. time: "2018-04-03 11:47:26",
  65. icon: "/icon.jpg",
  66. message: "软件用了有一段时间了,能查电费,能交电费,还是很方便的"
  67. }
  68. ],
  69. noCommets: []
  70. }
  71. }
  72. }
  73. </script>
  74. <style scoped>
  75. .commet-title {
  76. padding: 5px 10px;
  77. background: rgb(200, 200, 200);
  78. }
  79. .commet-title span {
  80. font-size: 18px;
  81. font-weight: bold;
  82. }
  83. .commet-show {
  84. padding-top: 25px;
  85. }
  86. .commet-list {
  87. min-height: 300px;
  88. border-right: solid;
  89. border-right-width: 1px;
  90. }
  91. .commet-list .no-commet {
  92. font-size: 20px;
  93. font-weight: 500;
  94. }
  95. .commet-submit {
  96. padding: 0 10px;
  97. }
  98. </style>