| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 | <template>	<view class="u-divider" :style="{		height: height == 'auto' ? 'auto' : height + 'rpx',		backgroundColor: bgColor,		marginBottom: marginBottom + 'rpx',		marginTop: marginTop + 'rpx'	}" @tap="click">		<view class="u-divider-line" :class="[type ? 'u-divider-line--bordercolor--' + type : '']" :style="[lineStyle]"></view>		<view v-if="useSlot" class="u-divider-text" :style="{			color: color,			fontSize: fontSize + 'rpx'		}"><slot /></view>		<view class="u-divider-line" :class="[type ? 'u-divider-line--bordercolor--' + type : '']" :style="[lineStyle]"></view>	</view></template><script>export default {	name: 'u-divider',	props: {				halfWidth: {			type: [Number, String],			default: 150		},				borderColor: {			type: String,			default: '#dcdfe6'		},				type: {			type: String,			default: 'primary'		},				color: {			type: String,			default: '#909399'		},				fontSize: {			type: [Number, String],			default: 26		},				bgColor: {			type: String,			default: '#ffffff'		},				height: {			type: [Number, String],			default: 'auto'		},				marginTop: {			type: [String, Number],			default: 0		},				marginBottom: {			type: [String, Number],			default: 0		},				useSlot: {			type: Boolean,			default: true		}	},	computed: {		lineStyle() {			let style = {};			if(String(this.halfWidth).indexOf('%') != -1) style.width = this.halfWidth;			else style.width = this.halfWidth + 'rpx';						if(this.borderColor) style.borderColor = this.borderColor;			return style;		}	},	methods: {		click() {			this.$emit('click');		}	}};</script><style lang="scss" scoped>@import "../../libs/css/style.components.scss";.u-divider {	width: 100%;	position: relative;	text-align: center;	@include vue-flex;	justify-content: center;	align-items: center;	overflow: hidden;	flex-direction: row;}.u-divider-line {	border-bottom: 1px solid $u-border-color;	transform: scale(1, 0.5);	transform-origin: center;		&--bordercolor--primary {		border-color: $u-type-primary;	}		&--bordercolor--success {		border-color: $u-type-success;	}		&--bordercolor--error {		border-color: $u-type-primary;	}		&--bordercolor--info {		border-color: $u-type-info;	}		&--bordercolor--warning {		border-color: $u-type-warning;	}}.u-divider-text {	white-space: nowrap;	padding: 0 16rpx;	/* #ifndef APP-NVUE */	display: inline-flex;			/* #endif */}</style>
 |