uni-list.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <!-- #ifndef APP-NVUE -->
  3. <view class="uni-list">
  4. <slot />
  5. </view>
  6. <!-- #endif -->
  7. <!-- #ifdef APP-NVUE -->
  8. <list class="uni-list" :enableBackToTop="enableBackToTop" loadmoreoffset="15" :scroll-y="scrollY" @loadmore="loadMore">
  9. <slot />
  10. </list>
  11. <!-- #endif -->
  12. </template>
  13. <script>
  14. export default {
  15. name: 'UniList',
  16. 'mp-weixin': {
  17. options: {
  18. multipleSlots: false
  19. }
  20. },
  21. props: {
  22. enableBackToTop: {
  23. type: [Boolean, String],
  24. default: false
  25. },
  26. scrollY: {
  27. type: [Boolean, String],
  28. default: false
  29. }
  30. },
  31. provide() {
  32. return {
  33. list: this
  34. }
  35. },
  36. created() {
  37. this.firstChildAppend = false
  38. },
  39. methods: {
  40. loadMore(e) {
  41. this.$emit("scrolltolower");
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. .uni-list {
  48. /* #ifndef APP-NVUE */
  49. display: flex;
  50. /* #endif */
  51. background-color: $uni-bg-color;
  52. position: relative;
  53. flex-direction: column;
  54. /* #ifdef MP-WEIXIN */
  55. width:690rpx;
  56. margin: auto;
  57. margin-top: 20rpx;
  58. background: #ffffff;
  59. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  60. border-radius: 20rpx;
  61. /* #endif */
  62. // border-bottom-color: $uni-border-color;
  63. // border-bottom-style: solid;
  64. // border-bottom-width: 1px;
  65. }
  66. /* #ifndef APP-NVUE */
  67. .uni-list:before {
  68. height: 0;
  69. }
  70. .uni-list:after {
  71. height: 0;
  72. }
  73. /* #endif */
  74. </style>