tn-color-icon.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <text
  3. class="tn-color-icon-class tn-color-icon"
  4. :class="[
  5. 'tn-color-icon-' + name
  6. ]"
  7. :style="{
  8. fontSize: size + unit,
  9. margin: margin
  10. }"
  11. @tap="handleClick"
  12. ></text>
  13. </template>
  14. <script>
  15. export default {
  16. name: 'tn-color-icon',
  17. props: {
  18. // 索引
  19. index: {
  20. type: [Number, String],
  21. default: '0'
  22. },
  23. // 图标名称
  24. name: {
  25. type: String,
  26. default: ''
  27. },
  28. // 图标大小
  29. size: {
  30. type: Number,
  31. default:32
  32. },
  33. // 大小单位
  34. unit: {
  35. type: String,
  36. default: 'px'
  37. },
  38. // 外边距
  39. margin: {
  40. type: String,
  41. default: '0'
  42. }
  43. },
  44. computed: {
  45. },
  46. data() {
  47. return {
  48. }
  49. },
  50. methods: {
  51. // 处理点击事件
  52. handleClick() {
  53. this.$emit("click", {
  54. index: Number(this.index)
  55. })
  56. this.$emit("tap", {
  57. index: Number(this.index)
  58. })
  59. }
  60. }
  61. }
  62. </script>
  63. <style scoped>
  64. @charset "UTF-8";
  65. @font-face {
  66. font-family: "tuniaoColorFont"; /* Project id 2445412 */
  67. /* Color fonts */
  68. src: url('iconfont.woff2?t=1632654518618') format('woff2');
  69. }
  70. .tn-color-icon {
  71. font-family: "tuniaoColorFont" !important;
  72. font-size: 16px;
  73. font-style: normal;
  74. -webkit-font-smoothing: antialiased;
  75. -moz-osx-font-smoothing: grayscale;
  76. text-align: center;
  77. text-decoration: none;
  78. }
  79. .tn-color-icon-logo-github:before {
  80. content: "\e601";
  81. }
  82. .tn-color-icon-logo-qq:before {
  83. content: "\e602";
  84. }
  85. .tn-color-icon-logo-weixin:before {
  86. content: "\e603";
  87. }
  88. .tn-color-icon-logo-alipay:before {
  89. content: "\e604";
  90. }
  91. .tn-color-icon-logo-weibo:before {
  92. content: "\e605";
  93. }
  94. .tn-color-icon-logo-dingtalk:before {
  95. content: "\e606";
  96. }
  97. .tn-color-icon-safe:before {
  98. content: "\e607";
  99. }
  100. .tn-color-icon-wifi:before {
  101. content: "\e608";
  102. }
  103. .tn-color-icon-help:before {
  104. content: "\e609";
  105. }
  106. .tn-color-icon-tag:before {
  107. content: "\e60a";
  108. }
  109. .tn-color-icon-play:before {
  110. content: "\e60b";
  111. }
  112. .tn-color-icon-stopwatch:before {
  113. content: "\e60c";
  114. }
  115. .tn-color-icon-home:before {
  116. content: "\e60d";
  117. }
  118. .tn-color-icon-map:before {
  119. content: "\e60e";
  120. }
  121. .tn-color-icon-book:before {
  122. content: "\e60f";
  123. }
  124. .tn-color-icon-qrcode:before {
  125. content: "\e610";
  126. }
  127. .tn-color-icon-discover:before {
  128. content: "\e611";
  129. }
  130. .tn-color-icon-visitor:before {
  131. content: "\e612";
  132. }
  133. .tn-color-icon-menu:before {
  134. content: "\e613";
  135. }
  136. .tn-color-icon-renew:before {
  137. content: "\e614";
  138. }
  139. .tn-color-icon-business:before {
  140. content: "\e615";
  141. }
  142. .tn-color-icon-telephone:before {
  143. content: "\e616";
  144. }
  145. .tn-color-icon-medicine:before {
  146. content: "\e617";
  147. }
  148. .tn-color-icon-chicken:before {
  149. content: "\e618";
  150. }
  151. .tn-color-icon-clock:before {
  152. content: "\e619";
  153. }
  154. .tn-color-icon-download:before {
  155. content: "\e61a";
  156. }
  157. .tn-color-icon-lamp:before {
  158. content: "\e61b";
  159. }
  160. .tn-color-icon-hourglass:before {
  161. content: "\e61c";
  162. }
  163. .tn-color-icon-calendar:before {
  164. content: "\e61d";
  165. }
  166. .tn-color-icon-bluetooth:before {
  167. content: "\e61e";
  168. }
  169. .tn-color-icon-fish:before {
  170. content: "\e61f";
  171. }
  172. .tn-color-icon-seal:before {
  173. content: "\e620";
  174. }
  175. .tn-color-icon-remind:before {
  176. content: "\e621";
  177. }
  178. .tn-color-icon-music:before {
  179. content: "\e622";
  180. }
  181. .tn-color-icon-email:before {
  182. content: "\e623";
  183. }
  184. .tn-color-icon-medal:before {
  185. content: "\e624";
  186. }
  187. .tn-color-icon-image:before {
  188. content: "\e625";
  189. }
  190. .tn-color-icon-network:before {
  191. content: "\e626";
  192. }
  193. .tn-color-icon-wallet:before {
  194. content: "\e627";
  195. }
  196. .tn-color-icon-program:before {
  197. content: "\e628";
  198. }
  199. .tn-color-icon-shrimp:before {
  200. content: "\e629";
  201. }
  202. .tn-color-icon-collect:before {
  203. content: "\e62a";
  204. }
  205. .tn-color-icon-screw:before {
  206. content: "\e62b";
  207. }
  208. .tn-color-icon-set:before {
  209. content: "\e62c";
  210. }
  211. .tn-color-icon-userfavorite:before {
  212. content: "\e62d";
  213. }
  214. .tn-color-icon-useradd:before {
  215. content: "\e62e";
  216. }
  217. .tn-color-icon-honor:before {
  218. content: "\e62f";
  219. }
  220. .tn-color-icon-shop:before {
  221. content: "\e630";
  222. }
  223. .tn-color-icon-usercard:before {
  224. content: "\e631";
  225. }
  226. .tn-color-icon-school:before {
  227. content: "\e632";
  228. }
  229. .tn-color-icon-user:before {
  230. content: "\e633";
  231. }
  232. .tn-color-icon-internet:before {
  233. content: "\e634";
  234. }
  235. .tn-color-icon-time:before {
  236. content: "\e635";
  237. }
  238. .tn-color-icon-topic:before {
  239. content: "\e636";
  240. }
  241. .tn-color-icon-phone:before {
  242. content: "\e637";
  243. }
  244. .tn-color-icon-usertable:before {
  245. content: "\e638";
  246. }
  247. .tn-color-icon-userset:before {
  248. content: "\e639";
  249. }
  250. .tn-color-icon-game:before {
  251. content: "\e63a";
  252. }
  253. </style>