uni-cms-article-icons.uvue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <view>
  3. <text class="uni-cms-article-icon" :style="{color, 'fontSize': size + 'px', lineHeight: size + 'px'}">{{iconCode}}</text>
  4. </view>
  5. </template>
  6. <script lang="uts">
  7. const icons: UTSJSONObject = {
  8. search: "\ue654",
  9. back: "\ue6b9",
  10. scan: "\ue62a",
  11. closeempty: "\ue66c",
  12. trash: "\ue687",
  13. reload: "\ue6b2",
  14. eye: "\ue651",
  15. 'eye-slash': '\ue6b3'
  16. }
  17. export default {
  18. name: 'uni-cms-article-icons',
  19. props: {
  20. type: {
  21. type: String,
  22. default: ""
  23. },
  24. color: {
  25. type: String,
  26. default: '#333333'
  27. },
  28. size: {
  29. type: Number,
  30. default: 16
  31. }
  32. },
  33. computed: {
  34. iconCode(): string {
  35. return icons.getString(this.type) as string
  36. }
  37. }
  38. }
  39. </script>
  40. <style>
  41. @font-face {
  42. font-family: "uni-cms-article-icons";
  43. src: url('/uni_modules/uni-cms-article/static/uniicons.ttf');
  44. }
  45. .uni-cms-article-icon {
  46. font-family: "uni-cms-article-icons";
  47. font-style: normal;
  48. }
  49. </style>