detail.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <div class="detail">
  3. <div class="top">
  4. <p v-text="listData.NC_TITLE">1</p>
  5. <span class="icon_new" v-text="listData.NC_READNUM">1</span>
  6. <span v-text="formatDate(listData.NC_PUBLISHDATE, 'yyyy-MM-dd hh:mm:ss')">1</span>
  7. </div>
  8. <div class="content" v-html="listData.NC_CONTENT"/>
  9. </div>
  10. </template>
  11. <script>
  12. import {formatDate} from '@/utils/date.js'
  13. export default {
  14. name: 'DetailView',
  15. computed: {
  16. listData () {
  17. return this.$store.state.news.detail.data.data
  18. }
  19. },
  20. methods: {
  21. // 格式化时间
  22. formatDate (row) {
  23. let date = new Date(row)
  24. return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
  25. }
  26. }
  27. }
  28. </script>
  29. <style type="text/scss" lang="scss">
  30. .detail{
  31. background: #fff;
  32. .top{
  33. padding:0 40px;
  34. padding-top:42px;
  35. height:146px;
  36. border-bottom:1px solid #f1f1f1;
  37. p{
  38. font-size: 30px;
  39. color:#1e1e1e;
  40. margin-bottom:30px;
  41. width:98%;
  42. overflow: hidden;
  43. text-overflow: ellipsis;
  44. white-space: nowrap;
  45. }
  46. span{
  47. font-size: 14px;
  48. color:#a0a0a0;
  49. margin-right:25px;
  50. &.icon_new:before{
  51. content: '';
  52. display: inline-block;
  53. width: 16px;
  54. height: 16px;
  55. margin-right: 10px;
  56. vertical-align: middle;
  57. background: url(/icon/new.png) no-repeat 0 2px;
  58. }
  59. }
  60. }
  61. .content{
  62. padding:42px 40px;
  63. line-height: 25px;
  64. font-size: 14px;
  65. color: #626262;
  66. p{
  67. font-size: 14px;
  68. color: #626262;
  69. text-indent: 2em;
  70. margin: 32px 0;
  71. }
  72. }
  73. }
  74. </style>