News.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <div class="news" style="overflow:hidden">
  3. <div class="imgarea">
  4. <img :src="img1" alt class="widthimg" />
  5. <div class="imgtext">
  6. <h1>新闻中心</h1>
  7. <h2>NEWS CENTER</h2>
  8. </div>
  9. </div>
  10. <div class="newscenter">
  11. <div class="newscenterhead">
  12. <p>新闻中心</p>
  13. <hr />
  14. </div>
  15. <div class="newsblock">
  16. <div class="block">
  17. <img :src="img2" />
  18. <p>心中有code,在哪儿都能改变世界</p>
  19. <p class="day">2019-7-23</p>
  20. </div>
  21. <div class="block">
  22. <img :src="img3" />
  23. <p>两年时间赚了19w,他究竟对芝麻开发做了什么</p>
  24. <p class="day">2019-7-23</p>
  25. </div>
  26. <div class="block">
  27. <img :src="img4" />
  28. <p>数说芝麻开发的2016</p>
  29. <p class="day">2019-7-23</p>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="listcontent">
  34. <div v-for="(item,index) in listnews" :key="index">
  35. <div class="newslist">
  36. <div class="newslistdays">
  37. <p class="days">06-23</p>
  38. <p>2019</p>
  39. </div>
  40. <div class="eachnews">
  41. <p>{{item.head}}</p>
  42. <p class="newscontent">{{item.content}}</p>
  43. </div>
  44. <div>
  45. <p>MORE</p>
  46. </div>
  47. </div>
  48. <hr />
  49. </div>
  50. </div>
  51. </div>
  52. </template>
  53. <script>
  54. import img1 from "../components/img/u305.jpg";
  55. import img2 from "../components/img/u313.png";
  56. import img3 from "../components/img/u314.png";
  57. import img4 from "../components/img/u315.png";
  58. // import img5 from ""
  59. export default {
  60. name: "News",
  61. // props: {
  62. // msg: String
  63. // }
  64. data() {
  65. return {
  66. img1: img1,
  67. img2: img2,
  68. img3: img3,
  69. img4: img4,
  70. listnews: [
  71. {
  72. head: "芝麻开发想项目服务透明化,用“工时制”取代“项目制“",
  73. content:
  74. "芝麻开发是一个以提供项目服务为导向的平台。项目服务有 IT 项目,包括网站建设、业务..."
  75. },
  76. {
  77. head: "心中有code,在哪都能改变世界!",
  78. content:
  79. "芝麻开发是一个以提供项目服务为导向的平台。项目服务有 IT 项目,包括网站建设、业务..."
  80. },
  81. {
  82. head: "2年业余时间赚了19w,他究竟在(dui)芝麻开发做了什么?",
  83. content:
  84. "芝麻开发是一个以提供项目服务为导向的平台。项目服务有 IT 项目,包括网站建设、业务..."
  85. },
  86. {
  87. head: "数说芝麻开发的2016",
  88. content:
  89. "芝麻开发是一个以提供项目服务为导向的平台。项目服务有 IT 项目,包括网站建设、业务..."
  90. },
  91. {
  92. head: "【芝麻Discovery】之芝麻勋章",
  93. content:
  94. "芝麻开发是一个以提供项目服务为导向的平台。项目服务有 IT 项目,包括网站建设、业务..."
  95. }
  96. ]
  97. };
  98. }
  99. };
  100. </script>
  101. <style scoped>
  102. *{
  103. text-align: left
  104. }
  105. .imgarea {
  106. position: relative;
  107. width: 100%;
  108. height: 400px;
  109. }
  110. .widthimg {
  111. position: absolute;
  112. width: 100%;
  113. height: 100%;
  114. display: flex;
  115. }
  116. .newslistdays {
  117. color: rgb(204, 204, 204);
  118. font-weight: 600;
  119. }
  120. .newslistdays p {
  121. margin-top: 0px;
  122. margin-bottom: 0px;
  123. }
  124. .listcontent {
  125. margin-top: 30px;
  126. margin-left: 50px;
  127. }
  128. p {
  129. font-size: 19px;
  130. padding-left: 10px;
  131. }
  132. .newscontent {
  133. color: rgb(107, 107, 107);
  134. font-size: 17px;
  135. }
  136. .newslist {
  137. display: flex;
  138. flex-direction: row;
  139. justify-content: space-between;
  140. padding-right: 20px;
  141. }
  142. .eachnews p {
  143. margin-bottom: 0px;
  144. }
  145. .days {
  146. color: rgb(174, 174, 174);
  147. font-size: 35px;
  148. margin-top: 15px !important;
  149. margin-bottom: 0px;
  150. }
  151. .imgtext {
  152. position: absolute;
  153. text-align: center;
  154. vertical-align: middle;
  155. width: 100%;
  156. height: 100%;
  157. display: flex;
  158. flex-direction: column;
  159. justify-content: center;
  160. }
  161. .newscenter {
  162. position: relative;
  163. margin-top: 0%;
  164. }
  165. .newscenterhead p{
  166. width: 90px;
  167. padding-left: 18px;
  168. display: flex;
  169. justify-content: flex-start;
  170. border-bottom: 1px solid rgb(121, 121, 121);
  171. margin-bottom: -7px;
  172. }
  173. .newsblock {
  174. position: relative;
  175. margin-top: 20px;
  176. display: flex;
  177. flex-direction: row;
  178. justify-content: space-around;
  179. }
  180. .block {
  181. width: 285px;
  182. height: 350px;
  183. display: flex;
  184. flex-direction: column;
  185. justify-content: space-between;
  186. border: 1px solid rgb(154, 154, 154);
  187. border-top: none;
  188. }
  189. .block img {
  190. width: 285px;
  191. height: 188px;
  192. }
  193. .imgtext h1 {
  194. color: black;
  195. }
  196. .imgtext h2 {
  197. color: rgb(102, 102, 102);
  198. }
  199. hr {
  200. color: rgb(154, 154, 154);
  201. }
  202. </style>