fontFamilyList.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <div class="fontFamilyList">
  3. <Header />
  4. <div class="main">
  5. <div class="seek">
  6. <input type="text" />
  7. <div>搜索</div>
  8. </div>
  9. <div class="list">
  10. <div v-for="(item, index) in data.list" :key="index">
  11. <div class="top">国际中文教育</div>
  12. <div class="bottom">
  13. <span>{{ item.fontFamily }}</span>
  14. <img
  15. v-if="item.collect"
  16. src="../../assets/teacherdev/font-collect-sele.png"
  17. alt=""
  18. />
  19. <img v-else src="../../assets/teacherdev/font-collect.png" alt="" />
  20. </div>
  21. </div>
  22. </div>
  23. <div class="page">
  24. <el-pagination
  25. background
  26. :page-sizes="[10, 20, 30, 40, 50]"
  27. layout="prev, pager, next"
  28. :current-page="page"
  29. :page-size="pageSize"
  30. :total="1000"
  31. >
  32. </el-pagination>
  33. </div>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  39. //例如:import 《组件名称》from ‘《组件路径》';
  40. import Header from "@/components/Header";
  41. export default {
  42. //import引入的组件需要注入到对象中才能使用
  43. components: { Header },
  44. props: {},
  45. data() {
  46. //这里存放数据
  47. return {
  48. page: 1,
  49. pageSize: 20,
  50. data: {
  51. list: [
  52. {
  53. fontFamily: "方正柳公权楷书",
  54. collect: true,
  55. },
  56. {
  57. fontFamily: "方正柳公权楷书",
  58. collect: false,
  59. },
  60. {
  61. fontFamily: "方正柳公权楷书",
  62. collect: true,
  63. },
  64. {
  65. fontFamily: "方正柳公权楷书",
  66. collect: false,
  67. },
  68. {
  69. fontFamily: "方正柳公权楷书",
  70. collect: true,
  71. },
  72. {
  73. fontFamily: "方正柳公权楷书",
  74. collect: false,
  75. },
  76. ],
  77. },
  78. };
  79. },
  80. //计算属性 类似于data概念
  81. computed: {},
  82. //监控data中数据变化
  83. watch: {},
  84. //方法集合
  85. methods: {},
  86. //生命周期 - 创建完成(可以访问当前this实例)
  87. created() {},
  88. //生命周期 - 挂载完成(可以访问DOM元素)
  89. mounted() {},
  90. //生命周期-创建之前
  91. beforeCreated() {},
  92. //生命周期-挂载之前
  93. beforeMount() {},
  94. //生命周期-更新之前
  95. beforUpdate() {},
  96. //生命周期-更新之后
  97. updated() {},
  98. //生命周期-销毁之前
  99. beforeDestory() {},
  100. //生命周期-销毁完成
  101. destoryed() {},
  102. //如果页面有keep-alive缓存功能,这个函数会触发
  103. activated() {},
  104. };
  105. </script>
  106. <style lang="scss" scoped>
  107. /* @import url(); 引入css类 */
  108. .fontFamilyList {
  109. .main {
  110. height: calc(100vh - 64px);
  111. background: #f2f2f2;
  112. padding-top: 40px;
  113. .seek {
  114. display: flex;
  115. justify-content: center;
  116. input {
  117. width: 468px;
  118. height: 51px;
  119. border: 1px solid #669aff;
  120. outline: none;
  121. }
  122. div {
  123. width: 96px;
  124. height: 51px;
  125. background: #669aff;
  126. border-width: 1px 1px 1px 0px;
  127. border-style: solid;
  128. border-color: #669aff;
  129. font-weight: 400;
  130. font-size: 16px;
  131. line-height: 51px;
  132. color: #ffffff;
  133. text-align: center;
  134. }
  135. }
  136. .list {
  137. width: 1200px;
  138. margin: 20px auto;
  139. display: flex;
  140. flex-wrap: wrap;
  141. > div {
  142. margin: 20px 25px;
  143. width: 248px;
  144. border-radius: 8px;
  145. overflow: hidden;
  146. .top {
  147. height: 87px;
  148. font-weight: 400;
  149. font-size: 36px;
  150. line-height: 87px;
  151. text-align: center;
  152. color: #ffffff;
  153. background: #7881a3;
  154. border-radius: 8px 8px 0px 0px;
  155. }
  156. .bottom {
  157. background: #ffffff;
  158. height: 40px;
  159. padding: 0 12px;
  160. display: flex;
  161. align-items: center;
  162. justify-content: space-between;
  163. font-weight: 400;
  164. font-size: 16px;
  165. line-height: 40px;
  166. color: #878787;
  167. img {
  168. width: 24px;
  169. height: 24px;
  170. }
  171. }
  172. }
  173. }
  174. .page {
  175. width: 1200px;
  176. margin: 0 auto;
  177. display: flex;
  178. justify-content: center;
  179. }
  180. }
  181. }
  182. </style>