bug
jiangping
2023-11-07 64b432916af9c9218ab3f3eca614e26c542142ae
minipro_standard/uni_modules/uview-ui/components/u-gap/u-gap.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
<template>
   <view class="u-gap" :style="[gapStyle]"></view>
</template>
<script>
   import props from './props.js';
   /**
    * gap é—´é𔿧½
    * @description è¯¥ç»„件一般用于内容块之间的用一个灰色块隔开的场景,方便用户风格统一,减少工作量
    * @tutorial https://www.uviewui.com/components/gap.html
    * @property {String}         bgColor         èƒŒæ™¯é¢œè‰² ï¼ˆé»˜è®¤ 'transparent' ï¼‰
    * @property {String | Number}   height         åˆ†å‰²æ§½é«˜åº¦ï¼Œå•位px ï¼ˆé»˜è®¤ 20 ï¼‰
    * @property {String | Number}   marginTop      ä¸Žå‰ä¸€ä¸ªç»„件的距离,单位px( é»˜è®¤ 0 ï¼‰
    * @property {String | Number}   marginBottom   ä¸ŽåŽä¸€ä¸ªç»„件的距离,单位px ï¼ˆé»˜è®¤ 0 ï¼‰
    * @property {Object}         customStyle      å®šä¹‰éœ€è¦ç”¨åˆ°çš„外部样式
    *
    * @example <u-gap height="80" bg-color="#bbb"></u-gap>
    */
   export default {
      name: "u-gap",
      mixins: [uni.$u.mpMixin, uni.$u.mixin,props],
      computed: {
         gapStyle() {
            const style = {
               backgroundColor: this.bgColor,
               height: uni.$u.addUnit(this.height),
               marginTop: uni.$u.addUnit(this.marginTop),
               marginBottom: uni.$u.addUnit(this.marginBottom),
            }
            return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle))
         }
      }
   };
</script>
<style lang="scss" scoped>
   @import "../../libs/css/components.scss";
</style>