From f26f29d84e0a68831a6af14dab3eec5500496d2e Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期三, 28 五月 2025 16:48:52 +0800 Subject: [PATCH] 初始化项目 --- uview-ui/components/u-row/u-row.vue | 84 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 84 insertions(+), 0 deletions(-) diff --git a/uview-ui/components/u-row/u-row.vue b/uview-ui/components/u-row/u-row.vue new file mode 100644 index 0000000..915dfa6 --- /dev/null +++ b/uview-ui/components/u-row/u-row.vue @@ -0,0 +1,84 @@ +<template> + <view class="u-row" :style="{ + alignItems: uAlignItem, + justifyContent: uJustify + }" + @tap="click" + > + <slot /> + </view> +</template> + +<script> + /** + * row 琛屽竷灞� + * @description 閫氳繃鍩虹鐨� 12 鍒嗘爮锛岃繀閫熺畝渚垮湴鍒涘缓甯冨眬銆� + * @tutorial https://www.uviewui.com/components/layout.html#row-props + * @property {String Number} gutter 鏍呮牸闂撮殧锛屽乏鍙冲悇涓烘鍊肩殑涓�鍗婏紝鍗曚綅rpx锛堥粯璁�0锛� + * @property {String} justify 姘村钩鎺掑垪鏂瑰紡(寰俊灏忕▼搴忔殏涓嶆敮鎸�)榛樿锛坰tart(鎴杅lex-start)锛� + * @property {String} align 鍨傜洿鎺掑垪鏂瑰紡锛堥粯璁enter锛� + * @example <u-row gutter="16"></u-row> + */ + export default { + name: "u-row", + props: { + // 缁檆ol娣诲姞闂磋窛锛屽乏鍙宠竟璺濆悇鍗犱竴鍗� + gutter: { + type: [String, Number], + default: 20 + }, + // 姘村钩鎺掑垪鏂瑰紡锛屽彲閫夊�间负`start`(鎴朻flex-start`)銆乣end`(鎴朻flex-end`)銆乣center`銆乣around`(鎴朻space-around`)銆乣between`(鎴朻space-between`) + justify: { + type: String, + default: 'start' + }, + // 鍨傜洿瀵归綈鏂瑰紡锛屽彲閫夊�间负top銆乧enter銆乥ottom + align: { + type: String, + default: 'center' + }, + // 鏄惁闃绘浜嬩欢浼犳挱 + stop: { + type: Boolean, + default: true + } + }, + computed: { + uJustify() { + if (this.justify == 'end' || this.justify == 'start') return 'flex-' + this.justify; + else if (this.justify == 'around' || this.justify == 'between') return 'space-' + this.justify; + else return this.justify; + }, + uAlignItem() { + if (this.align == 'top') return 'flex-start'; + if (this.align == 'bottom') return 'flex-end'; + else return this.align; + } + }, + methods: { + click(e) { + this.$emit('click'); + } + } + } +</script> + +<style lang="scss"> + @import "../../libs/css/style.components.scss"; + + .u-row { + // 鐢变簬寰俊灏忕▼搴忕紪璇戝悗濂囨�殑椤甸潰缁撴瀯锛屽彧鑳戒娇鐢╢loat甯冨眬瀹炵幇锛宖lex鏃犳硶瀹炵幇 + /* #ifndef MP-WEIXIN || MP-QQ || MP-TOUTIAO */ + @include vue-flex; + /* #endif */ + flex-wrap: wrap; + } + + .u-row:after { + /* #ifdef MP-WEIXIN || MP-QQ || MP-TOUTIAO */ + display: table; + clear: both; + content: ""; + /* #endif */ + } +</style> -- Gitblit v1.9.3