mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-04-16 21:02:42 +08:00
增加微信小程序版
This commit is contained in:
42
liferestartWX/utils/wux/divider/index.js
Normal file
42
liferestartWX/utils/wux/divider/index.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import baseComponent from '../helpers/baseComponent'
|
||||
import classNames from '../helpers/classNames'
|
||||
|
||||
baseComponent({
|
||||
properties: {
|
||||
prefixCls: {
|
||||
type: String,
|
||||
value: 'wux-divider',
|
||||
},
|
||||
position: {
|
||||
type: String,
|
||||
value: 'center',
|
||||
},
|
||||
dashed: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
text: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
showText: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
classes: ['prefixCls, dashed, showText, position', function(prefixCls, dashed, showText, position) {
|
||||
const wrap = classNames(prefixCls, {
|
||||
[`${prefixCls}--dashed`]: dashed,
|
||||
[`${prefixCls}--text`]: showText,
|
||||
[`${prefixCls}--text-${position}`]: showText && position,
|
||||
})
|
||||
const text = `${prefixCls}__text`
|
||||
|
||||
return {
|
||||
wrap,
|
||||
text,
|
||||
}
|
||||
}],
|
||||
},
|
||||
})
|
||||
3
liferestartWX/utils/wux/divider/index.json
Normal file
3
liferestartWX/utils/wux/divider/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
||||
6
liferestartWX/utils/wux/divider/index.wxml
Normal file
6
liferestartWX/utils/wux/divider/index.wxml
Normal file
@@ -0,0 +1,6 @@
|
||||
<view class="wux-class {{ classes.wrap }}">
|
||||
<view class="{{ classes.text }}" wx:if="{{ showText }}">
|
||||
{{ text }}
|
||||
<slot></slot>
|
||||
</view>
|
||||
</view>
|
||||
53
liferestartWX/utils/wux/divider/index.wxss
Normal file
53
liferestartWX/utils/wux/divider/index.wxss
Normal file
@@ -0,0 +1,53 @@
|
||||
.wux-divider {
|
||||
display: block;
|
||||
height: 2rpx;
|
||||
width: 100%;
|
||||
margin: 30rpx 0;
|
||||
clear: both;
|
||||
border-top: 2rpx solid #e8e8e8
|
||||
}
|
||||
.wux-divider--text {
|
||||
display: table;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
background: 0 0;
|
||||
font-weight: 500;
|
||||
color: rgba(0,0,0,.85);
|
||||
font-size: 32rpx;
|
||||
border-top: none!important
|
||||
}
|
||||
.wux-divider--text::after,
|
||||
.wux-divider--text::before {
|
||||
content: '';
|
||||
display: table-cell;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
width: 50%;
|
||||
border-top-width: 2rpx;
|
||||
border-top-style: solid;
|
||||
border-top-color: #e8e8e8;
|
||||
transform: translateY(50%)
|
||||
}
|
||||
.wux-divider--dashed {
|
||||
border-top: 2rpx dashed #e8e8e8
|
||||
}
|
||||
.wux-divider--dashed.wux-divider--text::after,
|
||||
.wux-divider--dashed.wux-divider--text::before {
|
||||
border-top-style: dashed
|
||||
}
|
||||
.wux-divider--text-left::before {
|
||||
width: 5%
|
||||
}
|
||||
.wux-divider--text-left::after {
|
||||
width: 95%
|
||||
}
|
||||
.wux-divider--text-right::before {
|
||||
width: 95%
|
||||
}
|
||||
.wux-divider--text-right::after {
|
||||
width: 5%
|
||||
}
|
||||
.wux-divider__text {
|
||||
display: inline-block;
|
||||
padding: 0 30rpx
|
||||
}
|
||||
Reference in New Issue
Block a user