news.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <div class="news">
  3. <div class="container">
  4. <div class="title">
  5. <a href="/news">更多</a>
  6. <p><i class="icon-trumpet"/>新闻动态</p>
  7. </div>
  8. <div class="content">
  9. <ul class="list-inline">
  10. <li class="info-list" v-for="item in list">
  11. <a :href="'/news/' + item.nc_id + '?type=' + item.nc_type">
  12. <img :src="item.nc_image">
  13. <div class="list-right">
  14. <p v-text="item.nc_title">企业为员工打造全新潼湖小镇,舒服办公环境</p>
  15. <span v-text="item.nc_desc">2017年,优软科技携手碧桂园创办全新智慧生态园,发扬优软新势力,适应互联网潮流 发展.</span>
  16. </div>
  17. </a>
  18. </li>
  19. </ul>
  20. </div>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. export default {
  26. name: 'News',
  27. computed: {
  28. list () {
  29. return this.$store.state.news.list.data.list
  30. }
  31. }
  32. }
  33. </script>
  34. <style scoped type="text/scss" lang="scss">
  35. .news{
  36. background: #fff;
  37. height:470px;
  38. .title{
  39. position:relative;
  40. a{
  41. position:absolute;
  42. right:0;
  43. top:65px;
  44. display:block;
  45. width:50px;
  46. height:26px;
  47. line-height: 26px;
  48. text-align: center;
  49. background: #eee;
  50. color:#797979;
  51. &:hover{
  52. cursor:pointer;
  53. color:#149ccf;
  54. }
  55. }
  56. p{
  57. line-height: 130px;
  58. font-size: 26px;
  59. color:#149ccf;
  60. margin:0;
  61. i{
  62. margin-right:10px;
  63. }
  64. }
  65. }
  66. .content{
  67. ul{
  68. li{
  69. width:580px;
  70. height:110px;
  71. border:1px solid #e5e5e5;
  72. padding:25px 16px;
  73. margin-bottom:30px;
  74. margin-right:10px;
  75. &:hover{
  76. cursor:pointer;
  77. box-shadow: 5px 5px 13px rgba(0,0,0,.14);
  78. border:none;
  79. }
  80. img{
  81. float:left;
  82. width:80px;
  83. height:55px;
  84. vertical-align:top;
  85. }
  86. .list-right{
  87. margin-left:100px;
  88. p{
  89. width:98%;
  90. font-size: 20px;
  91. color:#333;
  92. margin-bottom:20px;
  93. overflow: hidden;
  94. text-overflow:ellipsis;
  95. white-space:nowrap;
  96. }
  97. span{
  98. display:block;
  99. width:100%;
  100. font-size: 14px;
  101. color:#969696;
  102. overflow: hidden;
  103. text-overflow:ellipsis;
  104. white-space:nowrap;
  105. }
  106. }
  107. }
  108. }
  109. }
  110. }
  111. </style>