mali-applet-ui 0.0.33 → 0.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -32
- package/components/ml-approval-type/ml-approval-type.vue +0 -0
- package/components/ml-button/ml-button.vue +47 -23
- package/components/ml-checkbox/ml-checkbox.vue +1 -1
- package/components/ml-checkbox-group/ml-checkbox-group.vue +1 -1
- package/components/ml-chunk-group/ml-chunk-group.vue +113 -0
- package/components/ml-chunk-item/ml-chunk-item.vue +73 -0
- package/components/ml-col/ml-col.vue +1 -1
- package/components/ml-fixed-bottom/ml-fixed-bottom.vue +33 -0
- package/components/ml-form/ml-form.vue +1 -1
- package/components/ml-icon/ml-icon.vue +20 -1
- package/components/ml-input/ml-input.vue +1 -1
- package/components/ml-list-menu-group/ml-list-menu-group.vue +51 -0
- package/components/ml-list-menu-item/ml-list-menu-item.vue +128 -0
- package/components/ml-month-picker/ml-month-picker.vue +1 -1
- package/components/ml-number-input/ml-number-input.vue +1 -1
- package/components/ml-radio/ml-radio.vue +1 -1
- package/components/ml-radio-button/ml-radio-button.vue +1 -1
- package/components/ml-radio-group/ml-radio-group.vue +1 -1
- package/components/ml-row/ml-row.vue +1 -1
- package/components/ml-section/ml-section.vue +1 -1
- package/components/ml-select-picker/ml-select-picker.vue +1 -1
- package/components/ml-tabbar/ml-tabbar.vue +4 -1
- package/components/ml-textarea/ml-textarea.vue +1 -1
- package/components/ml-year-picker/ml-year-picker.vue +1 -1
- package/iconfont.css +681 -673
- package/package.json +1 -1
- package/components/ml-list-menu/ml-list-menu.vue +0 -79
package/README.md
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
# mali-applet-ui
|
|
2
|
-
|
|
3
|
-
Mali-Applet-UI 码里云小程序组件库
|
|
4
|
-
|
|
5
|
-
## 安装
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
# npm方式安装
|
|
9
|
-
npm install mali-applet-ui
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
## 按需引入
|
|
13
|
-
|
|
14
|
-
1. `pages.json`配置easycom规则(按需引入)
|
|
15
|
-
|
|
16
|
-
```js
|
|
17
|
-
// pages.json
|
|
18
|
-
{
|
|
19
|
-
"easycom": {
|
|
20
|
-
"autoscan": true,
|
|
21
|
-
"custom": {
|
|
22
|
-
"^ml-(.*)": "mali-applet-ui/components/ml-$1/ml-$1.vue"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
"pages": [
|
|
27
|
-
// ......
|
|
28
|
-
]
|
|
29
|
-
}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
深圳叮当科技技术有限公司
|
|
1
|
+
# mali-applet-ui
|
|
2
|
+
|
|
3
|
+
Mali-Applet-UI 码里云小程序组件库
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# npm方式安装
|
|
9
|
+
npm install mali-applet-ui
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 按需引入
|
|
13
|
+
|
|
14
|
+
1. `pages.json`配置easycom规则(按需引入)
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
// pages.json
|
|
18
|
+
{
|
|
19
|
+
"easycom": {
|
|
20
|
+
"autoscan": true,
|
|
21
|
+
"custom": {
|
|
22
|
+
"^ml-(.*)": "mali-applet-ui/components/ml-$1/ml-$1.vue"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
// 此为本身已有的内容
|
|
26
|
+
"pages": [
|
|
27
|
+
// ......
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
深圳叮当科技技术有限公司
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<button class="ml-button" :class="[className, `type-${type}`, status ? `status-${status}` : '', round ? 'is-round' : '']" @tap="tapEvent" @click="clickEvent">
|
|
2
|
+
<button class="ml-button" :class="[className || '', `type-${type}`, status ? `status-${status}` : '', round ? 'is-round' : '']" @tap="tapEvent" @click="clickEvent">
|
|
3
3
|
<slot>{{ content }}</slot>
|
|
4
4
|
</button>
|
|
5
5
|
</template>
|
|
@@ -33,35 +33,59 @@ export default {
|
|
|
33
33
|
|
|
34
34
|
<style lang="scss">
|
|
35
35
|
.ml-button {
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
&.type-text {
|
|
37
|
+
display: inline;
|
|
38
|
+
border: 0;
|
|
39
|
+
padding: 0 10rpx;
|
|
40
|
+
line-height: 1.5;
|
|
41
|
+
vertical-align: middle;
|
|
42
|
+
background: transparent;
|
|
43
|
+
&.status-primary {
|
|
44
|
+
color: $uni-color-primary;
|
|
45
|
+
}
|
|
46
|
+
&.status-success {
|
|
47
|
+
color: $uni-color-success;
|
|
48
|
+
}
|
|
49
|
+
&.status-info {
|
|
50
|
+
color: #909399;
|
|
51
|
+
}
|
|
52
|
+
&.status-warning {
|
|
53
|
+
color: $uni-color-warning;
|
|
54
|
+
}
|
|
55
|
+
&.status-danger {
|
|
56
|
+
color: $uni-color-error;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
38
59
|
&.type-button {
|
|
60
|
+
width: 100%;
|
|
61
|
+
margin: 0 10rpx;
|
|
62
|
+
padding: 0 20rpx;
|
|
39
63
|
line-height: 80rpx;
|
|
40
64
|
border: 1px solid #e5e5e5;
|
|
41
65
|
border-radius: 10rpx;
|
|
66
|
+
&.status-primary {
|
|
67
|
+
color: #ffffff;
|
|
68
|
+
background: $uni-color-primary;
|
|
69
|
+
}
|
|
70
|
+
&.status-success {
|
|
71
|
+
color: #ffffff;
|
|
72
|
+
background: $uni-color-success;
|
|
73
|
+
}
|
|
74
|
+
&.status-info {
|
|
75
|
+
color: #ffffff;
|
|
76
|
+
background: #909399;
|
|
77
|
+
}
|
|
78
|
+
&.status-warning {
|
|
79
|
+
color: #ffffff;
|
|
80
|
+
background: $uni-color-warning;
|
|
81
|
+
}
|
|
82
|
+
&.status-danger {
|
|
83
|
+
color: #ffffff;
|
|
84
|
+
background: $uni-color-error;
|
|
85
|
+
}
|
|
42
86
|
}
|
|
43
87
|
&.is-round {
|
|
44
88
|
border-radius: 40rpx;
|
|
45
89
|
}
|
|
46
|
-
&.status-primary {
|
|
47
|
-
color: #ffffff;
|
|
48
|
-
background: $uni-color-primary;
|
|
49
|
-
}
|
|
50
|
-
&.status-success {
|
|
51
|
-
color: #ffffff;
|
|
52
|
-
background: $uni-color-success;
|
|
53
|
-
}
|
|
54
|
-
&.status-info {
|
|
55
|
-
color: #ffffff;
|
|
56
|
-
background: #909399;
|
|
57
|
-
}
|
|
58
|
-
&.status-warning {
|
|
59
|
-
color: #ffffff;
|
|
60
|
-
background: $uni-color-warning;
|
|
61
|
-
}
|
|
62
|
-
&.status-danger {
|
|
63
|
-
color: #ffffff;
|
|
64
|
-
background: $uni-color-error;
|
|
65
|
-
}
|
|
66
90
|
}
|
|
67
91
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-checkbox" :class="[className, {'is-checked': checked, 'is-disabled': disabled}]" @tap="tapEvent">
|
|
2
|
+
<view class="ml-checkbox" :class="[className || '', {'is-checked': checked, 'is-disabled': disabled}]" @tap="tapEvent">
|
|
3
3
|
<ml-icon class="checkbox-icon" :name="checked ? 'checkbox-checked' : (indeterminate ? 'checkbox-indeterminate' : 'checkbox-unchecked')"></ml-icon>
|
|
4
4
|
<text class="checkbox-content">
|
|
5
5
|
<slot>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-radio-group" :class="[className, {'is-disabled': disabled, 'is-vertical': vertical}]">
|
|
2
|
+
<view class="ml-radio-group" :class="[className || '', {'is-disabled': disabled, 'is-vertical': vertical}]">
|
|
3
3
|
<view class="ml-radio-group-item" v-for="(item, index) in options" :key="index">
|
|
4
4
|
<ml-checkbox :value="value.includes(item.value) ? item.value : null" :label="item.value" :content="item.label" :disabled="disabled || item.disabled" @change="changeEvent"></ml-checkbox>
|
|
5
5
|
</view>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="ml-chunk-group" :class="[className || '', status ? `status-${status}` : '', align ? `align-${align}` : '', {'is-vertical': vertical, 'is-header': title || $slots.title}]">
|
|
3
|
+
<view v-if="title || $slots.title" class="ml-chunk-group-title">
|
|
4
|
+
<slot name="title">
|
|
5
|
+
<view v-if="prefixIcon" class="ml-chunk-group-left-icon">
|
|
6
|
+
<ml-icon :className="prefixIcon" :status="status"></ml-icon>
|
|
7
|
+
</view>
|
|
8
|
+
<text class="ml-chunk-group-title-content">{{ title }}</text>
|
|
9
|
+
</slot>
|
|
10
|
+
</view>
|
|
11
|
+
<view class="ml-chunk-group-body">
|
|
12
|
+
<view class="ml-chunk-group-content">
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</view>
|
|
15
|
+
</view>
|
|
16
|
+
</view>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
name: 'MlChunkGroup',
|
|
22
|
+
options: {
|
|
23
|
+
virtualHost: true
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
title: String,
|
|
27
|
+
prefixIcon: String,
|
|
28
|
+
vertical: Boolean,
|
|
29
|
+
status: String,
|
|
30
|
+
align: String,
|
|
31
|
+
className: String
|
|
32
|
+
},
|
|
33
|
+
provide() {
|
|
34
|
+
return {
|
|
35
|
+
mlChunk: this
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<style lang="scss">
|
|
42
|
+
.ml-chunk-group {
|
|
43
|
+
display: block;
|
|
44
|
+
border-radius: 10rpx;
|
|
45
|
+
background: #ffffff;
|
|
46
|
+
.ml-chunk-group-title {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: row;
|
|
49
|
+
align-items: center;
|
|
50
|
+
height: 70rpx;
|
|
51
|
+
padding: 0 20rpx ;
|
|
52
|
+
}
|
|
53
|
+
.ml-chunk-group-left-icon {
|
|
54
|
+
font-size: 38rpx;
|
|
55
|
+
flex-shrink: 0;
|
|
56
|
+
padding-right: 10rpx;
|
|
57
|
+
}
|
|
58
|
+
.ml-chunk-group-content {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: row;
|
|
61
|
+
border-radius: 10rpx;
|
|
62
|
+
}
|
|
63
|
+
&.is-header {
|
|
64
|
+
.ml-chunk-group-body {
|
|
65
|
+
padding: 0 20rpx;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
&.is-vertical {
|
|
69
|
+
.ml-chunk-group-content {
|
|
70
|
+
flex-direction: column;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
&.align-left {
|
|
74
|
+
text-align: left;
|
|
75
|
+
}
|
|
76
|
+
&.align-center {
|
|
77
|
+
text-align: center;
|
|
78
|
+
}
|
|
79
|
+
&.align-right {
|
|
80
|
+
text-align: right;
|
|
81
|
+
}
|
|
82
|
+
&.status-primary {
|
|
83
|
+
.ml-chunk-group-content {
|
|
84
|
+
color: #ffffff;
|
|
85
|
+
background: $uni-color-primary;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
&.status-success {
|
|
89
|
+
.ml-chunk-group-content {
|
|
90
|
+
color: #ffffff;
|
|
91
|
+
background: $uni-color-success;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
&.status-info {
|
|
95
|
+
.ml-chunk-group-content {
|
|
96
|
+
color: #ffffff;
|
|
97
|
+
background: #909399;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
&.status-warning {
|
|
101
|
+
.ml-chunk-group-content {
|
|
102
|
+
color: #ffffff;
|
|
103
|
+
background: $uni-color-warning;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
&.status-danger {
|
|
107
|
+
.ml-chunk-group-content {
|
|
108
|
+
color: #ffffff;
|
|
109
|
+
background: $uni-color-error;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
</style>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="ml-chunk-item" :class="[className || '', span && !width ? `span-${span}` : '', align ? `align-${align}` : '', {'is-fixed': width, 'is-vertical': isVertical}]" :style="styles">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</view>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
name: 'MlChunkItem',
|
|
10
|
+
options: {
|
|
11
|
+
virtualHost: true
|
|
12
|
+
},
|
|
13
|
+
props: {
|
|
14
|
+
span: [String, Number],
|
|
15
|
+
align: String,
|
|
16
|
+
width: String,
|
|
17
|
+
className: String
|
|
18
|
+
},
|
|
19
|
+
inject: {
|
|
20
|
+
chunk: {
|
|
21
|
+
from: 'mlChunk',
|
|
22
|
+
default: null
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
computed: {
|
|
26
|
+
isVertical () {
|
|
27
|
+
return this.chunk ? this.chunk.vertical : ''
|
|
28
|
+
},
|
|
29
|
+
styles () {
|
|
30
|
+
return this.width ? `width: ${this.width};` : ''
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style lang="scss">
|
|
37
|
+
.ml-chunk-item {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
padding: 10rpx;
|
|
41
|
+
line-height: 50rpx;
|
|
42
|
+
$spans: 4.16667%, 8.33333%, 12.5%, 16.66667%, 20.83333%, 25%, 29.16667%, 33.33333%,
|
|
43
|
+
37.5%, 41.66667%, 45.83333%, 50%, 54.16667%, 58.33333%, 62.5%, 66.66667%,
|
|
44
|
+
70.83333%, 75%, 79.16667%, 83.33333%, 87.5%, 91.66667%, 95.83333%, 100%;
|
|
45
|
+
&.align-left {
|
|
46
|
+
text-align: left;
|
|
47
|
+
}
|
|
48
|
+
&.align-center {
|
|
49
|
+
text-align: center;
|
|
50
|
+
}
|
|
51
|
+
&.align-right {
|
|
52
|
+
text-align: right;
|
|
53
|
+
}
|
|
54
|
+
&:not(.is-fixed) {
|
|
55
|
+
flex-grow: 1;
|
|
56
|
+
}
|
|
57
|
+
@for $index from 0 to length($spans) {
|
|
58
|
+
&.span-#{$index + 1} {
|
|
59
|
+
width: nth($spans, $index + 1);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
&:not(.is-vertical) {
|
|
63
|
+
border-right: 1px solid rgba(255, 255, 255, 0.2);
|
|
64
|
+
}
|
|
65
|
+
&.is-vertical {
|
|
66
|
+
flex-direction: row;
|
|
67
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
|
68
|
+
}
|
|
69
|
+
&:last-child {
|
|
70
|
+
border: 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-col" :class="[className, span && !width ? `span-${span}` : '', align ? `align-${align}` : '', width ? 'is-fixed' : '']" :style="styles">
|
|
2
|
+
<view class="ml-col" :class="[className || '', span && !width ? `span-${span}` : '', align ? `align-${align}` : '', width ? 'is-fixed' : '']" :style="styles">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</view>
|
|
5
5
|
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="ml-fixed-bottom" :class="[className || '']" :style="styles">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</view>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
name: 'MlFixedBottom',
|
|
10
|
+
options: {
|
|
11
|
+
virtualHost: true
|
|
12
|
+
},
|
|
13
|
+
props: {
|
|
14
|
+
bottom: String,
|
|
15
|
+
className: String
|
|
16
|
+
},
|
|
17
|
+
computed: {
|
|
18
|
+
styles () {
|
|
19
|
+
return this.bottom ? `bottom:${this.bottom};` : ''
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<style lang="scss">
|
|
26
|
+
.ml-fixed-bottom {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: row;
|
|
29
|
+
position: fixed;
|
|
30
|
+
width: 100%;
|
|
31
|
+
bottom: 40rpx;
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-form" :class="[className, {'is-vertical': vertical}]">
|
|
2
|
+
<view class="ml-form" :class="[className || '', {'is-vertical': vertical}]">
|
|
3
3
|
<uni-forms ref="uniForm" :modelValue="data" :rules="formRules" :label-position="vertical ? 'top' : 'left'">
|
|
4
4
|
<slot></slot>
|
|
5
5
|
</uni-forms>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<text class="ml-icon" :class="[className, name ? `${prefix}${name}` : '']" @click="clickEvent"></text>
|
|
2
|
+
<text class="ml-icon" :class="[className || '', status ? `status-${status}` : '', name ? `${prefix}${name}` : '']" @click="clickEvent"></text>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
@@ -10,6 +10,7 @@ export default {
|
|
|
10
10
|
},
|
|
11
11
|
props: {
|
|
12
12
|
name: String,
|
|
13
|
+
status: String,
|
|
13
14
|
className: String
|
|
14
15
|
},
|
|
15
16
|
data () {
|
|
@@ -27,4 +28,22 @@ export default {
|
|
|
27
28
|
|
|
28
29
|
<style lang="scss">
|
|
29
30
|
@import '../../iconfont.css';
|
|
31
|
+
|
|
32
|
+
.ml-icon {
|
|
33
|
+
&.status-primary {
|
|
34
|
+
color: $uni-color-primary;
|
|
35
|
+
}
|
|
36
|
+
&.status-success {
|
|
37
|
+
color: $uni-color-success;
|
|
38
|
+
}
|
|
39
|
+
&.status-info {
|
|
40
|
+
color: #909399;
|
|
41
|
+
}
|
|
42
|
+
&.status-warning {
|
|
43
|
+
color: $uni-color-warning;
|
|
44
|
+
}
|
|
45
|
+
&.status-danger {
|
|
46
|
+
color: $uni-color-error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
30
49
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-input" :class="[className, {'is-right': align === 'right', 'is-border': border, 'is-prefix': prefixIcon || type === 'search', 'is-suffix': suffixIcon, 'is-disabled': disabled}]">
|
|
2
|
+
<view class="ml-input" :class="[className || '', {'is-right': align === 'right', 'is-border': border, 'is-prefix': prefixIcon || type === 'search', 'is-suffix': suffixIcon, 'is-disabled': disabled}]">
|
|
3
3
|
<view v-if="prefixIcon || type === 'search'" class="ml-input-prefix-icon">
|
|
4
4
|
<ml-icon v-if="prefixIcon" :class="prefixIcon"></ml-icon>
|
|
5
5
|
<ml-icon v-else name="search"></ml-icon>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="ml-list-menu-group" :class="className">
|
|
3
|
+
<view v-if="title || $slots.title" class="ml-list-menu-group-title">
|
|
4
|
+
<view v-if="prefixIcon && prefixIcon !== 'none'" class="ml-list-menu-group-left-icon">
|
|
5
|
+
<ml-icon :className="prefixIcon"></ml-icon>
|
|
6
|
+
</view>
|
|
7
|
+
<slot name="title">
|
|
8
|
+
<text class="ml-list-menu-group-title-content">{{ title }}</text>
|
|
9
|
+
</slot>
|
|
10
|
+
</view>
|
|
11
|
+
<view class="ml-list-menu-group-content">
|
|
12
|
+
<slot></slot>
|
|
13
|
+
</view>
|
|
14
|
+
</view>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
export default {
|
|
19
|
+
name: 'MlListMenuGroup',
|
|
20
|
+
options: {
|
|
21
|
+
virtualHost: true
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
title: String,
|
|
25
|
+
prefixIcon: String,
|
|
26
|
+
className: String
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style lang="scss">
|
|
32
|
+
.ml-list-menu-group {
|
|
33
|
+
margin: 20rpx 0;
|
|
34
|
+
background: #ffffff;
|
|
35
|
+
.ml-list-menu-group-title {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: row;
|
|
38
|
+
align-items: center;
|
|
39
|
+
height: 70rpx;
|
|
40
|
+
}
|
|
41
|
+
.ml-list-menu-group-left-icon {
|
|
42
|
+
font-size: 38rpx;
|
|
43
|
+
flex-shrink: 0;
|
|
44
|
+
padding: 0 10rpx;
|
|
45
|
+
}
|
|
46
|
+
.ml-list-menu-group-content {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="ml-list-menu-item" :class="className" @click="clickEvent" @tap="tapEvent">
|
|
3
|
+
<view v-if="prefixIcon && prefixIcon !== 'none'" class="ml-list-menu-item-left-icon">
|
|
4
|
+
<ml-icon :className="prefixIcon"></ml-icon>
|
|
5
|
+
</view>
|
|
6
|
+
<view class="ml-list-menu-item-content">
|
|
7
|
+
<slot>
|
|
8
|
+
<text>{{ name }}</text>
|
|
9
|
+
</slot>
|
|
10
|
+
</view>
|
|
11
|
+
<view v-if="showDot" class="ml-list-menu-item-dot">
|
|
12
|
+
<text class="ml-list-menu-item-dot-num" :class="[dotStatus ? `status-${dotStatus}` : '']">{{ getDotNum(dotNum) }}</text>
|
|
13
|
+
</view>
|
|
14
|
+
<view v-if="suffixIcon && suffixIcon !== 'none'" class="ml-list-menu-item-right-icon">
|
|
15
|
+
<ml-icon :className="suffixIcon"></ml-icon>
|
|
16
|
+
</view>
|
|
17
|
+
</view>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
export default {
|
|
22
|
+
name: 'MlListMenuItem',
|
|
23
|
+
options: {
|
|
24
|
+
virtualHost: true
|
|
25
|
+
},
|
|
26
|
+
props: {
|
|
27
|
+
name: String,
|
|
28
|
+
prefixIcon: String,
|
|
29
|
+
suffixIcon: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: 'mlicon-arrow-right'
|
|
32
|
+
},
|
|
33
|
+
url: String,
|
|
34
|
+
redirect: Boolean,
|
|
35
|
+
className: String,
|
|
36
|
+
showDot: Boolean,
|
|
37
|
+
dotStatus: String,
|
|
38
|
+
dotNum: [String, Number]
|
|
39
|
+
},
|
|
40
|
+
methods: {
|
|
41
|
+
getDotNum (num) {
|
|
42
|
+
return num > 99 ? '99+' : num
|
|
43
|
+
},
|
|
44
|
+
clickEvent () {
|
|
45
|
+
this.$emit('click', {})
|
|
46
|
+
},
|
|
47
|
+
tapEvent () {
|
|
48
|
+
if (this.url) {
|
|
49
|
+
if (this.redirect) {
|
|
50
|
+
uni.redirectTo({
|
|
51
|
+
url: this.url
|
|
52
|
+
})
|
|
53
|
+
} else {
|
|
54
|
+
uni.navigateTo({
|
|
55
|
+
url: this.url
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
this.$emit('tap', {})
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<style lang="scss">
|
|
66
|
+
.ml-list-menu-item {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: row;
|
|
69
|
+
border-bottom: 1px solid #e5e5e5;
|
|
70
|
+
line-height: 90rpx;
|
|
71
|
+
font-size: 30rpx;
|
|
72
|
+
padding: 0 20rpx;
|
|
73
|
+
background: #ffffff;
|
|
74
|
+
&:first-child {
|
|
75
|
+
border-top: 1px solid #e5e5e5;
|
|
76
|
+
}
|
|
77
|
+
.ml-list-menu-item-content {
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: row;
|
|
80
|
+
flex-grow: 1;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
text-overflow: ellipsis;
|
|
83
|
+
white-space: nowrap;
|
|
84
|
+
}
|
|
85
|
+
.ml-list-menu-item-dot {
|
|
86
|
+
position: relative;
|
|
87
|
+
flex-shrink: 0;
|
|
88
|
+
.ml-list-menu-item-dot-num {
|
|
89
|
+
background-color: #f56c6c;
|
|
90
|
+
color: #fff;
|
|
91
|
+
border-radius: 40rpx;
|
|
92
|
+
padding: 0 10rpx;
|
|
93
|
+
vertical-align: middle;
|
|
94
|
+
display: inline-block;
|
|
95
|
+
min-width: 40rpx;
|
|
96
|
+
text-align: center;
|
|
97
|
+
font-size: 22rpx;
|
|
98
|
+
line-height: 40rpx;
|
|
99
|
+
&.status-primary {
|
|
100
|
+
background-color: $uni-color-primary;
|
|
101
|
+
}
|
|
102
|
+
&.status-success {
|
|
103
|
+
background-color: $uni-color-success;
|
|
104
|
+
}
|
|
105
|
+
&.status-info {
|
|
106
|
+
background-color: #909399;
|
|
107
|
+
}
|
|
108
|
+
&.status-warning {
|
|
109
|
+
background-color: $uni-color-warning;
|
|
110
|
+
}
|
|
111
|
+
&.status-danger {
|
|
112
|
+
background-color: $uni-color-error;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
.ml-list-menu-item-left-icon,
|
|
117
|
+
.ml-list-menu-item-right-icon {
|
|
118
|
+
flex-shrink: 0;
|
|
119
|
+
padding: 0 10rpx;
|
|
120
|
+
}
|
|
121
|
+
.ml-list-menu-item-left-icon {
|
|
122
|
+
font-size: 38rpx;
|
|
123
|
+
}
|
|
124
|
+
.ml-list-menu-item-right-icon {
|
|
125
|
+
font-size: 30rpx;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<picker :value="value" class="ml-month-picker" :class="[className, {'is-border': border}]" mode="date" fields="month" @change="changeEvent">
|
|
2
|
+
<picker :value="value" class="ml-month-picker" :class="[className || '', {'is-border': border}]" mode="date" fields="month" @change="changeEvent">
|
|
3
3
|
<view class="picker-warpper">
|
|
4
4
|
<view class="picker-text">{{ value || '请选择' }}</view>
|
|
5
5
|
<ml-icon class="picker-icon" name="arrow-down"></ml-icon>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
class="ml-number-input"
|
|
4
4
|
v-model="inpVal"
|
|
5
5
|
type="text"
|
|
6
|
-
:class="[className, {'is-right': align === 'right', 'is-border': border}]"
|
|
6
|
+
:class="[className || '', {'is-right': align === 'right', 'is-border': border}]"
|
|
7
7
|
autocomplete="off"
|
|
8
8
|
:placeholder="placeholder"
|
|
9
9
|
:maxlength="maxLength"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-radio" :class="[className, {'is-checked': checked, 'is-disabled': disabled}]" @tap="tapEvent">
|
|
2
|
+
<view class="ml-radio" :class="[className || '', {'is-checked': checked, 'is-disabled': disabled}]" @tap="tapEvent">
|
|
3
3
|
<ml-icon class="radio-icon" :name="checked ? 'radio-checked' : 'radio-unchecked'"></ml-icon>
|
|
4
4
|
<text class="radio-content">
|
|
5
5
|
<slot>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-radio-button" :class="[className, {'is-disabled': disabled}]">
|
|
2
|
+
<view class="ml-radio-button" :class="[className || '', {'is-disabled': disabled}]">
|
|
3
3
|
<view class="ml-radio-button-item" v-for="(item, index) in options" :class="{'is-active': value === item.value}" :key="index" @tap="changeEvent(item)">{{ item.label }}</view>
|
|
4
4
|
</view>
|
|
5
5
|
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-radio-group" :class="[className, {'is-disabled': disabled, 'is-vertical': vertical}]">
|
|
2
|
+
<view class="ml-radio-group" :class="[className || '', {'is-disabled': disabled, 'is-vertical': vertical}]">
|
|
3
3
|
<view class="ml-radio-group-item" v-for="(item, index) in options" :key="index">
|
|
4
4
|
<ml-radio :value="value" :label="item.value" :content="item.label" :disabled="disabled || item.disabled" @change="changeEvent"></ml-radio>
|
|
5
5
|
</view>
|