123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <template>
- <view class="u-section">
- <view class="u-section-title" :style="{
- fontWeight: bold ? 'bold' : 'normal',
- color: color,
- fontSize: fontSize + 'rpx',
- paddingLeft: showLine ? '10rpx' : 0
- }" :class="{
- 'u-section--line': showLine
- }">
- {{title}}
- </view>
- <view class="u-right-info" v-if="right" :style="{
- color: subColor
- }" @tap="rightClick">
- {{subTitle}}
- <view class="u-icon-arrow">
- <u-icon name="arrow-right" size="24" :color="subColor"></u-icon>
- </view>
- </view>
- </view>
- </template>
- <script>
-
- export default {
- name: "u-section",
- props: {
-
- title: {
- type: String,
- default: ''
- },
-
- subTitle: {
- type: String,
- default: '更多'
- },
-
- right: {
- type: Boolean,
- default: true
- },
- fontSize: {
- type: [Number, String],
- default: 28
- },
-
- bold: {
- type: Boolean,
- default: true
- },
-
- color: {
- type: String,
- default: '#303133'
- },
-
- subColor: {
- type: String,
- default: '#909399'
- },
-
- showLine: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {
-
- }
- },
- methods: {
- rightClick() {
- this.$emit('click');
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .u-section {
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 100%;
- }
-
- .u-section-title {
- position: relative;
- font-size: 28rpx;
- line-height: 1;
- }
-
- .u-section--line:after {
- position: absolute;
- width: 4px;
- height: 100%;
- content: '';
- left: 0;
- border-radius: 10px;
- background-color: currentColor;
- }
-
- .u-right-info {
- color: $u-tips-color;
- font-size: 26rpx;
- display: flex;
- align-items: center;
- }
-
- .u-icon-arrow {
- margin-left: 6rpx;
- }
- </style>
|