组件完善

feasure-livedata
lld 2026-03-25 20:14:00 +08:00
parent 072adeaa9a
commit 17e688b683
1 changed files with 11 additions and 2 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="container" :style="{padding: linePadding}"> <view class="container" :style="{padding: linePadding}">
<!-- 带文字的分割线 --> <!-- 带文字的分割线 -->
<view class="divider" :style="{margin: lineMargin}"> <view class="divider" :style="{margin: lineMargin,width: width}">
<view class="line" :style="{height: lineHeight,backgroundColor: lineColor}"></view> <view class="line" :style="{height: lineHeight,backgroundColor: lineColor}"></view>
<text :style="{padding: textPadding,fontSize: fontSize,color: fontColor,fontWeight: fontWeight}">{{ lineText }}</text> <text :style="{padding: textPadding,fontSize: fontSize,color: fontColor,fontWeight: fontWeight}">{{ lineText }}</text>
<view class="line" :style="{height: lineHeight,backgroundColor: lineColor,}"></view> <view class="line" :style="{height: lineHeight,backgroundColor: lineColor,}"></view>
@ -60,15 +60,24 @@ export default {
type: String, type: String,
default: '', default: '',
required: true required: true
},
width: {
type: String,
default: '100%'
} }
} }
}; };
</script> </script>
<style scoped> <style scoped>
.container {
width: 100%;
display: flex;
justify-content: center;
}
.divider { .divider {
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; justify-content: center;
} }
.line { .line {