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-table/u-table.vue | 84 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 84 insertions(+), 0 deletions(-) diff --git a/uview-ui/components/u-table/u-table.vue b/uview-ui/components/u-table/u-table.vue new file mode 100644 index 0000000..79df16f --- /dev/null +++ b/uview-ui/components/u-table/u-table.vue @@ -0,0 +1,84 @@ +<template> + <view class="u-table" :style="[tableStyle]"> + <slot /> + </view> +</template> + +<script> + /** + * table 琛ㄦ牸 + * @description 琛ㄦ牸缁勪欢涓�鑸敤浜庡睍绀哄ぇ閲忕粨鏋勫寲鏁版嵁鐨勫満鏅� + * @tutorial https://www.uviewui.com/components/table.html + * @property {String} border-color 琛ㄦ牸杈规鐨勯鑹诧紙榛樿#e4e7ed锛� + * @property {String} bg-color 琛ㄦ牸鐨勮儗鏅鑹诧紙榛樿#ffffff锛� + * @property {String} align 鍗曞厓鏍肩殑鍐呭瀵归綈鏂瑰紡锛屼綔鐢ㄧ被浼糲ss鐨則ext-align锛堥粯璁enter锛� + * @property {String} padding 鍗曞厓鏍肩殑鍐呰竟璺濓紝鍚宑ss鐨刾adding鍐欐硶锛堥粯璁�10rpx 0锛� + * @property {String Number} font-size 鍗曞厓鏍煎瓧浣撳ぇ灏忥紝鍗曚綅rpx锛堥粯璁�28锛� + * @property {String} color 鍗曞厓鏍煎瓧浣撻鑹诧紙榛樿#606266锛� + * @property {Object} th-style th鍗曞厓鏍肩殑鏍峰紡锛屽璞″舰寮�(灏唗h鎵�闇�鍙傛暟鏀惧湪table缁勪欢锛屾槸涓轰簡閬垮厤姣忎竴涓猼h缁勪欢瑕佸啓涓�閬嶏級 + * @event {Function} click 鐐瑰嚮缁勪欢鏃惰Е鍙� + * @event {Function} close 鐐瑰嚮鍏抽棴鎸夐挳鏃惰Е鍙� + * @example <u-table></u-table> + */ + export default { + name: "u-table", + props: { + borderColor: { + type: String, + default: '#e4e7ed' + }, + align: { + type: String, + default: 'center' + }, + // td鐨勫唴杈硅窛 + padding: { + type: String, + default: '10rpx 6rpx' + }, + // 瀛椾綋澶у皬 + fontSize: { + type: [String, Number], + default: 28 + }, + // 瀛椾綋棰滆壊 + color: { + type: String, + default: '#606266' + }, + // th鐨勮嚜瀹氫箟鏍峰紡 + thStyle: { + type: Object, + default () { + return {} + } + }, + // table鐨勮儗鏅鑹� + bgColor: { + type: String, + default: '#ffffff' + } + }, + data() { + return {} + }, + computed: { + tableStyle() { + let style = {}; + style.borderLeft = `solid 1px ${this.borderColor}`; + style.borderTop = `solid 1px ${this.borderColor}`; + style.backgroundColor = this.bgColor;; + return style; + } + } + } +</script> + +<style lang="scss" scoped> + @import "../../libs/css/style.components.scss"; + + .u-table { + width: 100%; + box-sizing: border-box; + } +</style> -- Gitblit v1.9.3