listSkeleton.vue 860 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <view class="skeleton-template">
  3. <image :src="setSrc" mode="widthFix"></image>
  4. </view>
  5. </template>
  6. <script>
  7. var self;
  8. export default{
  9. data() {
  10. return{
  11. skeletonList: {
  12. empty: 'https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AaQCxAAB0ju39mYk608.png',
  13. },
  14. skeletonMemList: {
  15. empty: 'https://img.caimei365.com/group1/M00/03/72/Cmis2F3xt_CALrJcAAEE4AHIZ1g310.png',
  16. },
  17. }
  18. },
  19. props:{
  20. listType:String,
  21. src: {
  22. type: String,
  23. default: 'empty'
  24. }
  25. },
  26. created(){
  27. },
  28. computed: {
  29. setSrc() {
  30. let url;
  31. if(this.listType== 0){
  32. url = this.skeletonList[this.src]
  33. }else{
  34. url = this.skeletonMemList[this.src]
  35. }
  36. return url;
  37. },
  38. },
  39. }
  40. </script>
  41. <style lang="scss">
  42. .skeleton-template {
  43. image {
  44. width: 100%;
  45. height: 100%;
  46. }
  47. }
  48. </style>