Icon.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <div>
  3. <div class="crumbs">
  4. <el-breadcrumb separator="/">
  5. <el-breadcrumb-item><i class="el-icon-lx-emoji"></i> 自定义图标</el-breadcrumb-item>
  6. </el-breadcrumb>
  7. </div>
  8. <div class="container">
  9. <h2>使用方法</h2>
  10. <p style="line-height: 50px;">
  11. 直接通过设置类名为 el-icon-lx-iconName 来使用即可。例如:(共{{iconList.length}}个图标)
  12. </p>
  13. <p class="example-p">
  14. <i class="el-icon-lx-redpacket_fill" style="font-size: 30px;color: #ff5900"></i>
  15. <span>&lt;i class=&quot;el-icon-lx-redpacket_fill&quot;&gt;&lt;/i&gt;</span>
  16. </p>
  17. <p class="example-p">
  18. <i class="el-icon-lx-weibo" style="font-size: 30px;color:#fd5656"></i>
  19. <span>&lt;i class=&quot;el-icon-lx-weibo&quot;&gt;&lt;/i&gt;</span>
  20. </p>
  21. <p class="example-p">
  22. <i class="el-icon-lx-emojifill" style="font-size: 30px;color: #ffc300"></i>
  23. <span>&lt;i class=&quot;el-icon-lx-emojifill&quot;&gt;&lt;/i&gt;</span>
  24. </p>
  25. <br>
  26. <h2>图标</h2>
  27. <div class="search-box">
  28. <el-input class="search" size="large" v-model="keyword" clearable placeholder="请输入图标名称"></el-input>
  29. </div>
  30. <ul>
  31. <li class="icon-li" v-for="(item,index) in list" :key="index">
  32. <div class="icon-li-content">
  33. <i :class="`el-icon-lx-${item}`"></i>
  34. <span>{{item}}</span>
  35. </div>
  36. </li>
  37. </ul>
  38. </div>
  39. </div>
  40. </template>
  41. <script>
  42. export default {
  43. data: function(){
  44. return {
  45. keyword: '',
  46. iconList: [
  47. 'attentionforbid',
  48. 'attentionforbidfill',
  49. 'attention',
  50. 'attentionfill',
  51. 'tag',
  52. 'tagfill',
  53. 'people',
  54. 'peoplefill',
  55. 'notice',
  56. 'noticefill',
  57. 'mobile',
  58. 'mobilefill',
  59. 'voice',
  60. 'voicefill',
  61. 'unlock',
  62. 'lock',
  63. 'home',
  64. 'homefill',
  65. 'delete',
  66. 'deletefill',
  67. 'notification',
  68. 'notificationfill',
  69. 'notificationforbidfill',
  70. 'like',
  71. 'likefill',
  72. 'comment',
  73. 'commentfill',
  74. 'camera',
  75. 'camerafill',
  76. 'warn',
  77. 'warnfill',
  78. 'time',
  79. 'timefill',
  80. 'location',
  81. 'locationfill',
  82. 'favor',
  83. 'favorfill',
  84. 'skin',
  85. 'skinfill',
  86. 'news',
  87. 'newsfill',
  88. 'record',
  89. 'recordfill',
  90. 'emoji',
  91. 'emojifill',
  92. 'message',
  93. 'messagefill',
  94. 'goods',
  95. 'goodsfill',
  96. 'crown',
  97. 'crownfill',
  98. 'move',
  99. 'add',
  100. 'hot',
  101. 'hotfill',
  102. 'service',
  103. 'servicefill',
  104. 'present',
  105. 'presentfill',
  106. 'pic',
  107. 'picfill',
  108. 'rank',
  109. 'rankfill',
  110. 'male',
  111. 'female',
  112. 'down',
  113. 'top',
  114. 'recharge',
  115. 'rechargefill',
  116. 'forward',
  117. 'forwardfill',
  118. 'info',
  119. 'infofill',
  120. 'redpacket',
  121. 'redpacket_fill',
  122. 'roundadd',
  123. 'roundaddfill',
  124. 'friendadd',
  125. 'friendaddfill',
  126. 'cart',
  127. 'cartfill',
  128. 'more',
  129. 'moreandroid',
  130. 'back',
  131. 'right',
  132. 'shop',
  133. 'shopfill',
  134. 'question',
  135. 'questionfill',
  136. 'roundclose',
  137. 'roundclosefill',
  138. 'roundcheck',
  139. 'roundcheckfill',
  140. 'global',
  141. 'mail',
  142. 'punch',
  143. 'exit',
  144. 'upload',
  145. 'read',
  146. 'file',
  147. 'link',
  148. 'full',
  149. 'group',
  150. 'friend',
  151. 'profile',
  152. 'addressbook',
  153. 'calendar',
  154. 'text',
  155. 'copy',
  156. 'share',
  157. 'wifi',
  158. 'vipcard',
  159. 'weibo',
  160. 'remind',
  161. 'refresh',
  162. 'filter',
  163. 'settings',
  164. 'scan',
  165. 'qrcode',
  166. 'cascades',
  167. 'apps',
  168. 'sort',
  169. 'searchlist',
  170. 'search',
  171. 'edit'
  172. ]
  173. }
  174. },
  175. computed: {
  176. list(){
  177. return this.iconList.filter((item) => {
  178. return item.indexOf(this.keyword) !== -1;
  179. })
  180. }
  181. }
  182. }
  183. </script>
  184. <style scoped>
  185. .example-p{
  186. height: 45px;
  187. display: flex;
  188. align-items: center;
  189. }
  190. .search-box{
  191. text-align: center;
  192. margin-top: 10px;
  193. }
  194. .search{
  195. width: 300px;
  196. }
  197. ul,li{
  198. list-style: none;
  199. }
  200. .icon-li{
  201. display: inline-block;
  202. padding: 10px;
  203. width: 120px;
  204. height: 120px;
  205. }
  206. .icon-li-content{
  207. display: flex;
  208. height: 100%;
  209. flex-direction: column;
  210. align-items: center;
  211. justify-content: center;
  212. cursor: pointer;
  213. }
  214. .icon-li-content i{
  215. font-size: 36px;
  216. color: #606266;
  217. }
  218. .icon-li-content span{
  219. margin-top: 10px;
  220. color: #787878;
  221. }
  222. </style>