From d1448cb0ef10f358bb7bddb4e1ec268515e0b787 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期二, 15 七月 2025 11:46:57 +0800 Subject: [PATCH] 项目初始化 --- uni_modules/uview-ui/components/u-gap/u-gap.vue | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-) diff --git a/uni_modules/uview-ui/components/u-gap/u-gap.vue b/uni_modules/uview-ui/components/u-gap/u-gap.vue new file mode 100644 index 0000000..e4429f0 --- /dev/null +++ b/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 涓庡墠涓�涓粍浠剁殑璺濈锛屽崟浣峱x锛� 榛樿 0 锛� + * @property {String | Number} marginBottom 涓庡悗涓�涓粍浠剁殑璺濈锛屽崟浣峱x 锛堥粯璁� 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> -- Gitblit v1.9.3