mali-applet-ui 0.0.22 → 0.0.23
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/components/ml-button/ml-button.vue +4 -0
- package/components/ml-checkbox/ml-checkbox.vue +1 -1
- package/components/ml-col/ml-col.vue +53 -0
- package/components/ml-radio/ml-radio.vue +1 -1
- package/components/ml-row/ml-row.vue +3 -0
- package/components/ml-section/ml-section.vue +41 -0
- package/components/ml-tabs/ml-tabs.vue +14 -4
- package/package.json +1 -1
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
<script>
|
|
8
8
|
export default {
|
|
9
9
|
name: 'ml-button',
|
|
10
|
+
options: {
|
|
11
|
+
virtualHost: true
|
|
12
|
+
},
|
|
10
13
|
props: {
|
|
11
14
|
content: String,
|
|
12
15
|
status: String,
|
|
@@ -30,6 +33,7 @@ export default {
|
|
|
30
33
|
<style lang="scss">
|
|
31
34
|
.ml-button {
|
|
32
35
|
width: 100%;
|
|
36
|
+
margin: 0 10rpx;
|
|
33
37
|
&.type-button {
|
|
34
38
|
line-height: 80rpx;
|
|
35
39
|
border: 1px solid #e5e5e5;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="ml-col" :class="[span && !width ? `span-${span}` : '', align ? `align-${align}` : '', width ? 'is-fixed' : '']" :style="styles">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</view>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
name: 'MlCol',
|
|
10
|
+
options: {
|
|
11
|
+
virtualHost: true
|
|
12
|
+
},
|
|
13
|
+
props: {
|
|
14
|
+
span: [String, Number],
|
|
15
|
+
align: String,
|
|
16
|
+
width: String
|
|
17
|
+
},
|
|
18
|
+
computed: {
|
|
19
|
+
styles () {
|
|
20
|
+
const rest = {}
|
|
21
|
+
if (this.width) {
|
|
22
|
+
rest.width = this.width
|
|
23
|
+
}
|
|
24
|
+
return rest
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style lang="scss">
|
|
31
|
+
.ml-col {
|
|
32
|
+
$spans: 4.16667%, 8.33333%, 12.5%, 16.66667%, 20.83333%, 25%, 29.16667%, 33.33333%,
|
|
33
|
+
37.5%, 41.66667%, 45.83333%, 50%, 54.16667%, 58.33333%, 62.5%, 66.66667%,
|
|
34
|
+
70.83333%, 75%, 79.16667%, 83.33333%, 87.5%, 91.66667%, 95.83333%, 100%;
|
|
35
|
+
&.align-left {
|
|
36
|
+
text-align: left;
|
|
37
|
+
}
|
|
38
|
+
&.align-center {
|
|
39
|
+
text-align: center;
|
|
40
|
+
}
|
|
41
|
+
&.align-right {
|
|
42
|
+
text-align: right;
|
|
43
|
+
}
|
|
44
|
+
&:not(.is-fixed) {
|
|
45
|
+
flex-grow: 1;
|
|
46
|
+
}
|
|
47
|
+
@for $index from 0 to length($spans) {
|
|
48
|
+
&.span-#{$index + 1} {
|
|
49
|
+
width: nth($spans, $index + 1);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="ml-section" :class="[type ? `type-${type}` : '']">
|
|
3
|
+
<view v-if="title || $slots.header" class="ml-section-header">
|
|
4
|
+
<slot name="header">
|
|
5
|
+
<text class="ml-section-header-title">{{ title }}</text>
|
|
6
|
+
</slot>
|
|
7
|
+
</view>
|
|
8
|
+
<view class="ml-section-content">
|
|
9
|
+
<slot></slot>
|
|
10
|
+
</view>
|
|
11
|
+
</view>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
export default {
|
|
16
|
+
name: 'MlSection',
|
|
17
|
+
props: {
|
|
18
|
+
title: String,
|
|
19
|
+
type: String
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style lang="scss">
|
|
25
|
+
.ml-section {
|
|
26
|
+
&.type-line {
|
|
27
|
+
.ml-section-header-title {
|
|
28
|
+
border-left: 2px solid $uni-color-primary;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
.ml-section-header {
|
|
32
|
+
padding: 10rpx 20rpx;
|
|
33
|
+
.ml-section-header-title {
|
|
34
|
+
padding-left: 20rpx;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
.ml-section-content {
|
|
38
|
+
padding: 0 20rpx;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</style>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="ml-tabs">
|
|
3
|
-
<scroll-view
|
|
4
|
-
<view class="ml-tabs-
|
|
3
|
+
<scroll-view scroll-x>
|
|
4
|
+
<view class="ml-tabs-navs">
|
|
5
|
+
<view class="ml-tabs-nav-item" v-for="(item, index) in options" :key="index" :class="{'is-active': value === item.value}" @tap="changeEvent(item)">{{ item.label }}</view>
|
|
6
|
+
</view>
|
|
5
7
|
</scroll-view>
|
|
6
8
|
</view>
|
|
7
9
|
</template>
|
|
@@ -28,10 +30,18 @@ export default {
|
|
|
28
30
|
<style lang="scss">
|
|
29
31
|
.ml-tabs {
|
|
30
32
|
.ml-tabs-navs {
|
|
31
|
-
display:
|
|
33
|
+
display: inline-block;
|
|
34
|
+
white-space: nowrap;
|
|
32
35
|
}
|
|
33
36
|
.ml-tabs-nav-item {
|
|
34
|
-
|
|
37
|
+
position: relative;
|
|
38
|
+
display: inline-block;
|
|
39
|
+
padding: 10rpx 20rpx;
|
|
40
|
+
margin: 0 10rpx;
|
|
41
|
+
&.is-active {
|
|
42
|
+
color: $uni-color-primary;
|
|
43
|
+
border-bottom: 1px solid $uni-color-primary;
|
|
44
|
+
}
|
|
35
45
|
}
|
|
36
46
|
}
|
|
37
47
|
</style>
|