mali-applet-ui 0.2.43 → 0.2.45

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.
@@ -1,7 +1,15 @@
1
1
  <template>
2
- <text class="ml-dict-type" :class="[className || '', (status || showStatus) && selectStatus ? `ss-${selectStatus}` : '', {'is-underline': underline, 'is-border': border, 'is-round': round}]">
3
- <slot>{{ selectLabel }}</slot>
4
- </text>
2
+ <view class="ml-dict-type" :class="[className || '', (status || showStatus) && selectStatus ? `ss-${selectStatus}` : '', {'is-underline': underline, 'is-border': border, 'is-round': round}]">
3
+ <view v-if="prefixIcon && prefixIcon !== 'none'" class="ml-dict-type-left-icon">
4
+ <ml-icon :className="prefixIcon"></ml-icon>
5
+ </view>
6
+ <view class="ml-dict-type-content">
7
+ <slot>{{ selectLabel }}</slot>
8
+ </view>
9
+ <view v-if="suffixIcon && suffixIcon !== 'none'" class="ml-dict-type-right-icon">
10
+ <ml-icon :className="suffixIcon"></ml-icon>
11
+ </view>
12
+ </view>
5
13
  </template>
6
14
 
7
15
  <script>
@@ -18,6 +26,8 @@ export default {
18
26
  status: String,
19
27
  round: Boolean,
20
28
  border: Boolean,
29
+ prefixIcon: String,
30
+ suffixIcon: String,
21
31
  showStatus: Boolean,
22
32
  underline: Boolean,
23
33
  optionProps: Object,
@@ -52,6 +62,7 @@ export default {
52
62
 
53
63
  <style lang="scss">
54
64
  .ml-dict-type {
65
+ display: inline-block;
55
66
  padding: 0 4rpx;
56
67
  &+.ml-dict-type {
57
68
  margin-left: 20rpx;
@@ -190,5 +201,10 @@ export default {
190
201
  color: $ml-purple-color;
191
202
  }
192
203
  }
204
+ .ml-dict-type-left-icon,
205
+ .ml-dict-type-right-icon,
206
+ .ml-dict-type-content {
207
+ display: inline;
208
+ }
193
209
  }
194
210
  </style>
@@ -1,8 +1,14 @@
1
1
  <template>
2
- <view class="ml-status-tag" :class="[className, status ? `ss-${status}` : '']" :style="styles">
3
- <slot>
4
- <text>{{ content }}</text>
5
- </slot>
2
+ <view class="ml-status-tag" :class="[className || '', status ? `ss-${status}` : '']" :style="styles">
3
+ <view v-if="prefixIcon && prefixIcon !== 'none'" class="ml-status-tag-left-icon">
4
+ <ml-icon :className="prefixIcon"></ml-icon>
5
+ </view>
6
+ <view class="ml-status-tag-content">
7
+ <slot>{{ content }}</slot>
8
+ </view>
9
+ <view v-if="suffixIcon && suffixIcon !== 'none'" class="ml-status-tag-right-icon">
10
+ <ml-icon :className="suffixIcon"></ml-icon>
11
+ </view>
6
12
  </view>
7
13
  </template>
8
14
 
@@ -16,6 +22,8 @@ export default {
16
22
  color: String,
17
23
  content: String,
18
24
  status: String,
25
+ prefixIcon: String,
26
+ suffixIcon: String,
19
27
  className: String
20
28
  },
21
29
  computed: {
@@ -66,5 +74,10 @@ export default {
66
74
  &.ss-purple {
67
75
  background: $ml-purple-color;
68
76
  }
77
+ .ml-status-tag-left-icon,
78
+ .ml-status-tag-right-icon,
79
+ .ml-status-tag-content {
80
+ display: inline;
81
+ }
69
82
  }
70
83
  </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="ml-tabbar" :class="className">
2
+ <view class="ml-tabbar" :class="[className || '', {'is-vertical': vertical}]">
3
3
  <view class="ml-tabbar-item" v-for="(item) in options" :key="item.value" :class="{'is-active': value == item.value}" @tap="tapEvent(item)">
4
4
  <view class="ml-tabbar-icon">
5
5
  <ml-icon class="icon" :name="value == item.value ? item.activeIcon : item.icon"></ml-icon>
@@ -16,6 +16,7 @@ export default {
16
16
  name: 'MlTabbar',
17
17
  props: {
18
18
  value: [String, Number],
19
+ vertical: Boolean,
19
20
  options: Array,
20
21
  className: String
21
22
  },
@@ -63,24 +64,38 @@ export default {
63
64
  <style lang="scss">
64
65
  .ml-tabbar {
65
66
  display: flex;
66
- flex-direction: row;
67
- width: 100%;
68
67
  position: fixed;
69
- left: 0;
70
- bottom: 0;
71
68
  z-index: 22;
72
69
  padding: 6rpx 0 12rpx 0;
73
70
  color: $uni-text-color;
74
71
  background: #FFFFFF;
75
72
  border-top: 1px solid #e5e5e5;
76
- // #ifdef H5
77
- max-width: $ml-page-full-width;
78
- left: 50%;
79
- transform: translateX(-50%);
80
- // #endif
73
+ &.is-vertical {
74
+ flex-direction: column;
75
+ left: 0;
76
+ top: 0;
77
+ width: 120rpx;
78
+ height: 100%;
79
+ .ml-tabbar-item {
80
+ justify-content: center;
81
+ }
82
+ }
83
+ &:not(.is-vertical) {
84
+ left: 0;
85
+ bottom: 0;
86
+ flex-direction: row;
87
+ width: 100%;
88
+ // #ifdef H5
89
+ max-width: $ml-page-full-width;
90
+ left: 50%;
91
+ transform: translateX(-50%);
92
+ // #endif
93
+ }
81
94
  .ml-tabbar-item {
95
+ display: flex;
96
+ flex-direction: column;
82
97
  flex-grow: 1;
83
- text-align: center;
98
+ align-items: center;
84
99
  &.is-active {
85
100
  border: 0;
86
101
  color: $uni-color-primary;
@@ -89,7 +104,7 @@ export default {
89
104
  .ml-tabbar-dot-num {
90
105
  position: absolute;
91
106
  top: 0;
92
- left: 114rpx;
107
+ right: -16rpx;
93
108
  background-color: #f56c6c;
94
109
  color: #fff;
95
110
  border-radius: 20rpx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "0.2.43",
3
+ "version": "0.2.45",
4
4
  "description": "码里云小程序组件库",
5
5
  "scripts": {
6
6
  "release": "node script/release.js && npm publish"
package/theme.scss CHANGED
@@ -1,8 +1,5 @@
1
1
  // 页面宽度
2
- $ml-page-full-width: 100vw;
3
- // #ifdef H5
4
- $ml-page-full-width: 1200px;
5
- // #endif
2
+ $ml-page-full-width: 100%;
6
3
 
7
4
  // 页面间隔宽度
8
5
  $ml-page-interval-margin: 16rpx;