@kengic/uni 0.5.1 → 0.5.2-beta.1
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/dist/uni/uni-ui/uni-badge/uni-badge.vue +222 -219
- package/dist/uni/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +29 -29
- package/dist/uni/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +88 -88
- package/dist/uni/uni-ui/uni-calendar/calendar.js +936 -532
- package/dist/uni/uni-ui/uni-calendar/i18n/en.json +10 -10
- package/dist/uni/uni-ui/uni-calendar/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hans.json +10 -10
- package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hant.json +10 -10
- package/dist/uni/uni-ui/uni-calendar/uni-calendar-item.vue +190 -168
- package/dist/uni/uni-ui/uni-calendar/uni-calendar.vue +459 -459
- package/dist/uni/uni-ui/uni-calendar/util.js +324 -340
- package/dist/uni/uni-ui/uni-card/uni-card.vue +8 -1
- package/dist/uni/uni-ui/uni-col/uni-col.vue +294 -287
- package/dist/uni/uni-ui/uni-collapse/uni-collapse.vue +139 -140
- package/dist/uni/uni-ui/uni-collapse-item/uni-collapse-item.vue +381 -378
- package/dist/uni/uni-ui/uni-combox/uni-combox.vue +280 -272
- package/dist/uni/uni-ui/uni-countdown/i18n/en.json +4 -4
- package/dist/uni/uni-ui/uni-countdown/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hans.json +4 -4
- package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hant.json +4 -4
- package/dist/uni/uni-ui/uni-countdown/uni-countdown.vue +249 -257
- package/dist/uni/uni-ui/uni-data-checkbox/uni-data-checkbox.vue +832 -813
- package/dist/uni/uni-ui/uni-data-picker/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-data-picker/uni-data-picker.vue +535 -516
- package/dist/uni/uni-ui/uni-data-pickerview/uni-data-picker.js +623 -618
- package/dist/uni/uni-ui/uni-data-pickerview/uni-data-pickerview.vue +293 -288
- package/dist/uni/uni-ui/uni-data-select/uni-data-select.vue +495 -509
- package/dist/uni/uni-ui/uni-dateformat/date-format.js +181 -184
- package/dist/uni/uni-ui/uni-dateformat/uni-dateformat.vue +81 -82
- package/dist/uni/uni-ui/uni-datetime-picker/calendar-item.vue +176 -170
- package/dist/uni/uni-ui/uni-datetime-picker/calendar.vue +926 -920
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/en.json +20 -20
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hans.json +21 -21
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hant.json +21 -21
- package/dist/uni/uni-ui/uni-datetime-picker/time-picker.vue +921 -926
- package/dist/uni/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +1059 -1012
- package/dist/uni/uni-ui/uni-datetime-picker/util.js +366 -377
- package/dist/uni/uni-ui/uni-drawer/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-drawer/uni-drawer.vue +176 -167
- package/dist/uni/uni-ui/uni-easyinput/common.js +40 -42
- package/dist/uni/uni-ui/uni-easyinput/uni-easyinput.vue +628 -547
- package/dist/uni/uni-ui/uni-fab/uni-fab.vue +507 -483
- package/dist/uni/uni-ui/uni-fav/i18n/en.json +2 -2
- package/dist/uni/uni-ui/uni-fav/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-fav/i18n/zh-Hans.json +2 -2
- package/dist/uni/uni-ui/uni-fav/i18n/zh-Hant.json +2 -2
- package/dist/uni/uni-ui/uni-fav/uni-fav.vue +155 -147
- package/dist/uni/uni-ui/uni-file-picker/choose-and-upload-file.js +172 -198
- package/dist/uni/uni-ui/uni-file-picker/uni-file-picker.vue +636 -634
- package/dist/uni/uni-ui/uni-file-picker/upload-file.vue +294 -293
- package/dist/uni/uni-ui/uni-file-picker/upload-image.vue +267 -270
- package/dist/uni/uni-ui/uni-file-picker/utils.js +81 -82
- package/dist/uni/uni-ui/uni-forms/uni-forms.vue +360 -372
- package/dist/uni/uni-ui/uni-forms/utils.js +170 -174
- package/dist/uni/uni-ui/uni-forms/validate.js +447 -456
- package/dist/uni/uni-ui/uni-forms-item/uni-forms-item.vue +497 -497
- package/dist/uni/uni-ui/uni-goods-nav/i18n/en.json +4 -4
- package/dist/uni/uni-ui/uni-goods-nav/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hans.json +4 -4
- package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hant.json +4 -4
- package/dist/uni/uni-ui/uni-goods-nav/uni-goods-nav.vue +238 -222
- package/dist/uni/uni-ui/uni-grid/uni-grid.vue +134 -134
- package/dist/uni/uni-ui/uni-grid-item/uni-grid-item.vue +121 -119
- package/dist/uni/uni-ui/uni-group/uni-group.vue +121 -121
- package/dist/uni/uni-ui/uni-icons/icons.js +1170 -1168
- package/dist/uni/uni-ui/uni-icons/uni-icons.vue +91 -86
- package/dist/uni/uni-ui/uni-icons/uniicons.css +166 -166
- package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list-item.vue +129 -129
- package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list.vue +352 -347
- package/dist/uni/uni-ui/uni-link/uni-link.vue +134 -119
- package/dist/uni/uni-ui/uni-list/uni-list.vue +119 -110
- package/dist/uni/uni-ui/uni-list/uni-refresh.vue +14 -14
- package/dist/uni/uni-ui/uni-list/uni-refresh.wxs +14 -14
- package/dist/uni/uni-ui/uni-list-ad/uni-list-ad.vue +101 -95
- package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.scss +18 -18
- package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.vue +602 -586
- package/dist/uni/uni-ui/uni-list-item/uni-list-item.vue +507 -503
- package/dist/uni/uni-ui/uni-load-more/i18n/en.json +3 -3
- package/dist/uni/uni-ui/uni-load-more/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hans.json +3 -3
- package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hant.json +3 -3
- package/dist/uni/uni-ui/uni-load-more/uni-load-more.vue +402 -392
- package/dist/uni/uni-ui/uni-nav-bar/uni-nav-bar.vue +328 -330
- package/dist/uni/uni-ui/uni-nav-bar/uni-status-bar.vue +17 -17
- package/dist/uni/uni-ui/uni-notice-bar/uni-notice-bar.vue +422 -401
- package/dist/uni/uni-ui/uni-number-box/uni-number-box.vue +211 -205
- package/dist/uni/uni-ui/uni-pagination/i18n/en.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/es.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/fr.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/index.js +12 -11
- package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hans.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hant.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/uni-pagination.vue +450 -433
- package/dist/uni/uni-ui/uni-popup/uni-popup.vue +404 -404
- package/dist/uni/uni-ui/uni-popup-dialog/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +1 -0
- package/dist/uni/uni-ui/uni-popup-message/uni-popup-message.vue +126 -125
- package/dist/uni/uni-ui/uni-popup-share/uni-popup-share.vue +172 -172
- package/dist/uni/uni-ui/uni-rate/uni-rate.vue +343 -347
- package/dist/uni/uni-ui/uni-row/uni-row.vue +180 -182
- package/dist/uni/uni-ui/uni-scss/changelog.md +11 -4
- package/dist/uni/uni-ui/uni-scss/package.json +73 -73
- package/dist/uni/uni-ui/uni-scss/readme.md +2 -1
- package/dist/uni/uni-ui/uni-scss/styles/setting/_border.scss +2 -2
- package/dist/uni/uni-ui/uni-scss/styles/setting/_color.scss +46 -47
- package/dist/uni/uni-ui/uni-scss/styles/setting/_radius.scss +49 -49
- package/dist/uni/uni-ui/uni-scss/styles/setting/_space.scss +52 -53
- package/dist/uni/uni-ui/uni-scss/styles/setting/_styles.scss +142 -147
- package/dist/uni/uni-ui/uni-scss/styles/setting/_text.scss +20 -20
- package/dist/uni/uni-ui/uni-scss/styles/setting/_variables.scss +111 -95
- package/dist/uni/uni-ui/uni-scss/styles/tools/functions.scss +28 -18
- package/dist/uni/uni-ui/uni-scss/theme.scss +10 -7
- package/dist/uni/uni-ui/uni-scss/variables.scss +42 -24
- package/dist/uni/uni-ui/uni-search-bar/i18n/en.json +3 -3
- package/dist/uni/uni-ui/uni-search-bar/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hans.json +2 -2
- package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hant.json +2 -2
- package/dist/uni/uni-ui/uni-search-bar/uni-search-bar.vue +290 -281
- package/dist/uni/uni-ui/uni-section/uni-section.vue +149 -146
- package/dist/uni/uni-ui/uni-segmented-control/uni-segmented-control.vue +141 -131
- package/dist/uni/uni-ui/uni-steps/uni-steps.vue +255 -236
- package/dist/uni/uni-ui/uni-swipe-action/uni-swipe-action.vue +51 -51
- package/dist/uni/uni-ui/uni-swipe-action-item/bindingx.js +276 -282
- package/dist/uni/uni-ui/uni-swipe-action-item/isPC.js +10 -10
- package/dist/uni/uni-ui/uni-swipe-action-item/mpalipay.js +182 -187
- package/dist/uni/uni-ui/uni-swipe-action-item/mpother.js +235 -244
- package/dist/uni/uni-ui/uni-swipe-action-item/mpwxs.js +70 -75
- package/dist/uni/uni-ui/uni-swipe-action-item/render.js +238 -247
- package/dist/uni/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +387 -313
- package/dist/uni/uni-ui/uni-swipe-action-item/wx.wxs +206 -215
- package/dist/uni/uni-ui/uni-swiper-dot/uni-swiper-dot.vue +241 -197
- package/dist/uni/uni-ui/uni-table/uni-table.vue +445 -447
- package/dist/uni/uni-ui/uni-tag/uni-tag.vue +234 -244
- package/dist/uni/uni-ui/uni-tbody/uni-tbody.vue +20 -23
- package/dist/uni/uni-ui/uni-td/uni-td.vue +79 -80
- package/dist/uni/uni-ui/uni-th/filter-dropdown.vue +510 -503
- package/dist/uni/uni-ui/uni-th/uni-th.vue +289 -273
- package/dist/uni/uni-ui/uni-thead/uni-thead.vue +115 -114
- package/dist/uni/uni-ui/uni-title/uni-title.vue +151 -154
- package/dist/uni/uni-ui/uni-tooltip/uni-tooltip.vue +55 -60
- package/dist/uni/uni-ui/uni-tr/table-checkbox.vue +162 -163
- package/dist/uni/uni-ui/uni-tr/uni-tr.vue +158 -157
- package/dist/uni/uni-ui/uni-transition/createAnimation.js +130 -113
- package/dist/uni/uni-ui/uni-transition/uni-transition.vue +274 -272
- package/package.json +1 -1
|
@@ -1,129 +1,130 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
<!-- #ifdef H5 -->
|
|
3
|
+
<thead class="uni-table-thead">
|
|
4
|
+
<tr class="uni-table-tr">
|
|
5
|
+
<th :rowspan="rowspan" colspan="1" class="checkbox" :class="{ 'tr-table--border': border }">
|
|
6
|
+
<table-checkbox :indeterminate="indeterminate" :checked="checked" @checkboxSelected="checkboxSelected"></table-checkbox>
|
|
7
|
+
</th>
|
|
8
|
+
</tr>
|
|
9
|
+
<slot></slot>
|
|
10
|
+
</thead>
|
|
11
|
+
<!-- #endif -->
|
|
12
|
+
<!-- #ifndef H5 -->
|
|
13
|
+
<view class="uni-table-thead"><slot></slot></view>
|
|
14
|
+
<!-- #endif -->
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script>
|
|
18
|
-
import tableCheckbox from '../uni-tr/table-checkbox.vue'
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
18
|
+
import tableCheckbox from '../uni-tr/table-checkbox.vue';
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
name: 'uniThead',
|
|
22
|
+
components: {
|
|
23
|
+
tableCheckbox,
|
|
24
|
+
},
|
|
25
|
+
options: {
|
|
26
|
+
virtualHost: true,
|
|
27
|
+
},
|
|
28
|
+
data() {
|
|
29
|
+
return {
|
|
30
|
+
border: false,
|
|
31
|
+
selection: false,
|
|
32
|
+
rowspan: 1,
|
|
33
|
+
indeterminate: false,
|
|
34
|
+
checked: false,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
created() {
|
|
38
|
+
this.root = this.getTable();
|
|
39
|
+
// #ifdef H5
|
|
40
|
+
this.root.theadChildren = this;
|
|
41
|
+
// #endif
|
|
42
|
+
this.border = this.root.border;
|
|
43
|
+
this.selection = this.root.type;
|
|
44
|
+
},
|
|
45
|
+
methods: {
|
|
46
|
+
init(self) {
|
|
47
|
+
this.rowspan++;
|
|
48
|
+
},
|
|
49
|
+
checkboxSelected(e) {
|
|
50
|
+
this.indeterminate = false;
|
|
51
|
+
const backIndexData = this.root.backIndexData;
|
|
52
|
+
const data = this.root.trChildren.filter((v) => !v.disabled && v.keyValue);
|
|
53
|
+
if (backIndexData.length === data.length) {
|
|
54
|
+
this.checked = false;
|
|
55
|
+
this.root.clearSelection();
|
|
56
|
+
} else {
|
|
57
|
+
this.checked = true;
|
|
58
|
+
this.root.selectionAll();
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* 获取父元素实例
|
|
63
|
+
*/
|
|
64
|
+
getTable(name = 'uniTable') {
|
|
65
|
+
let parent = this.$parent;
|
|
66
|
+
let parentName = parent.$options.name;
|
|
67
|
+
while (parentName !== name) {
|
|
68
|
+
parent = parent.$parent;
|
|
69
|
+
if (!parent) return false;
|
|
70
|
+
parentName = parent.$options.name;
|
|
71
|
+
}
|
|
72
|
+
return parent;
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
};
|
|
75
76
|
</script>
|
|
76
77
|
|
|
77
78
|
<style lang="scss">
|
|
78
|
-
$border-color: #ebeef5;
|
|
79
|
+
$border-color: #ebeef5;
|
|
79
80
|
|
|
80
|
-
.uni-table-thead {
|
|
81
|
-
|
|
82
|
-
}
|
|
81
|
+
.uni-table-thead {
|
|
82
|
+
display: table-header-group;
|
|
83
|
+
}
|
|
83
84
|
|
|
84
|
-
.uni-table-tr {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
85
|
+
.uni-table-tr {
|
|
86
|
+
/* #ifndef APP-NVUE */
|
|
87
|
+
display: table-row;
|
|
88
|
+
transition: all 0.3s;
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
/* #endif */
|
|
91
|
+
border: 1px red solid;
|
|
92
|
+
background-color: #fafafa;
|
|
93
|
+
}
|
|
93
94
|
|
|
94
|
-
.checkbox {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
95
|
+
.checkbox {
|
|
96
|
+
padding: 0 8px;
|
|
97
|
+
width: 26px;
|
|
98
|
+
padding-left: 12px;
|
|
99
|
+
/* #ifndef APP-NVUE */
|
|
100
|
+
display: table-cell;
|
|
101
|
+
vertical-align: middle;
|
|
102
|
+
/* #endif */
|
|
103
|
+
color: #333;
|
|
104
|
+
font-weight: 500;
|
|
105
|
+
border-bottom: 1px $border-color solid;
|
|
106
|
+
font-size: 14px;
|
|
107
|
+
// text-align: center;
|
|
108
|
+
}
|
|
108
109
|
|
|
109
|
-
.tr-table--border {
|
|
110
|
-
|
|
111
|
-
}
|
|
110
|
+
.tr-table--border {
|
|
111
|
+
border-right: 1px $border-color solid;
|
|
112
|
+
}
|
|
112
113
|
|
|
113
|
-
/* #ifndef APP-NVUE */
|
|
114
|
-
.uni-table-tr {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
114
|
+
/* #ifndef APP-NVUE */
|
|
115
|
+
.uni-table-tr {
|
|
116
|
+
::v-deep .uni-table-th {
|
|
117
|
+
&.table--border:last-child {
|
|
118
|
+
// border-right: none;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
120
121
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
122
|
+
::v-deep .uni-table-td {
|
|
123
|
+
&.table--border:last-child {
|
|
124
|
+
// border-right: none;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
127
128
|
|
|
128
|
-
/* #endif */
|
|
129
|
+
/* #endif */
|
|
129
130
|
</style>
|
|
@@ -1,171 +1,168 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
<view class="uni-title__box" :style="{ 'align-items': textAlign }">
|
|
3
|
+
<text class="uni-title__base" :class="['uni-' + type]" :style="{ color: color }">{{ title }}</text>
|
|
4
|
+
</view>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Title 标题
|
|
10
|
+
* @description 标题,通常用于记录页面标题,使用当前组件,uni-app 如果开启统计,将会自动统计页面标题
|
|
11
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=1066
|
|
12
|
+
* @property {String} type = [h1|h2|h3|h4|h5] 标题类型
|
|
13
|
+
* @value h1 一级标题
|
|
14
|
+
* @value h2 二级标题
|
|
15
|
+
* @value h3 三级标题
|
|
16
|
+
* @value h4 四级标题
|
|
17
|
+
* @value h5 五级标题
|
|
18
|
+
* @property {String} title 标题内容
|
|
19
|
+
* @property {String} align = [left|center|right] 对齐方式
|
|
20
|
+
* @value left 做对齐
|
|
21
|
+
* @value center 居中对齐
|
|
22
|
+
* @value right 右对齐
|
|
23
|
+
* @property {String} color 字体颜色
|
|
24
|
+
* @property {Boolean} stat = [true|false] 是否开启统计功能呢,如不填写type值,默认为开启,填写 type 属性,默认为关闭
|
|
25
|
+
*/
|
|
26
|
+
export default {
|
|
27
|
+
name: 'UniTitle',
|
|
28
|
+
props: {
|
|
29
|
+
type: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: '',
|
|
32
|
+
},
|
|
33
|
+
title: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: '',
|
|
36
|
+
},
|
|
37
|
+
align: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: 'left',
|
|
40
|
+
},
|
|
41
|
+
color: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: '#333333',
|
|
44
|
+
},
|
|
45
|
+
stat: {
|
|
46
|
+
type: [Boolean, String],
|
|
47
|
+
default: '',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
data() {
|
|
51
|
+
return {};
|
|
52
|
+
},
|
|
53
|
+
computed: {
|
|
54
|
+
textAlign() {
|
|
55
|
+
let align = 'center';
|
|
56
|
+
switch (this.align) {
|
|
57
|
+
case 'left':
|
|
58
|
+
align = 'flex-start';
|
|
59
|
+
break;
|
|
60
|
+
case 'center':
|
|
61
|
+
align = 'center';
|
|
62
|
+
break;
|
|
63
|
+
case 'right':
|
|
64
|
+
align = 'flex-end';
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
return align;
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
watch: {
|
|
71
|
+
title(newVal) {
|
|
72
|
+
if (this.isOpenStat()) {
|
|
73
|
+
// 上报数据
|
|
74
|
+
if (uni.report) {
|
|
75
|
+
uni.report('title', this.title);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
mounted() {
|
|
81
|
+
if (this.isOpenStat()) {
|
|
82
|
+
// 上报数据
|
|
83
|
+
if (uni.report) {
|
|
84
|
+
uni.report('title', this.title);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
methods: {
|
|
89
|
+
isOpenStat() {
|
|
90
|
+
if (this.stat === '') {
|
|
91
|
+
this.isStat = false;
|
|
92
|
+
}
|
|
93
|
+
let stat_type = (typeof this.stat === 'boolean' && this.stat) || (typeof this.stat === 'string' && this.stat !== '');
|
|
94
|
+
if (this.type === '') {
|
|
95
|
+
this.isStat = true;
|
|
96
|
+
if (this.stat.toString() === 'false') {
|
|
97
|
+
this.isStat = false;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
52
100
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
case 'right':
|
|
66
|
-
align = 'flex-end'
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
return align
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
watch: {
|
|
73
|
-
title(newVal) {
|
|
74
|
-
if (this.isOpenStat()) {
|
|
75
|
-
// 上报数据
|
|
76
|
-
if (uni.report) {
|
|
77
|
-
uni.report('title', this.title)
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
mounted() {
|
|
83
|
-
if (this.isOpenStat()) {
|
|
84
|
-
// 上报数据
|
|
85
|
-
if (uni.report) {
|
|
86
|
-
uni.report('title', this.title)
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
methods: {
|
|
91
|
-
isOpenStat() {
|
|
92
|
-
if (this.stat === '') {
|
|
93
|
-
this.isStat = false
|
|
94
|
-
}
|
|
95
|
-
let stat_type = (typeof(this.stat) === 'boolean' && this.stat) || (typeof(this.stat) === 'string' && this.stat !==
|
|
96
|
-
'')
|
|
97
|
-
if (this.type === "") {
|
|
98
|
-
this.isStat = true
|
|
99
|
-
if (this.stat.toString() === 'false') {
|
|
100
|
-
this.isStat = false
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (this.type !== '') {
|
|
105
|
-
this.isStat = true
|
|
106
|
-
if (stat_type) {
|
|
107
|
-
this.isStat = true
|
|
108
|
-
} else {
|
|
109
|
-
this.isStat = false
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return this.isStat
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
101
|
+
if (this.type !== '') {
|
|
102
|
+
this.isStat = true;
|
|
103
|
+
if (stat_type) {
|
|
104
|
+
this.isStat = true;
|
|
105
|
+
} else {
|
|
106
|
+
this.isStat = false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return this.isStat;
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
};
|
|
116
113
|
</script>
|
|
117
114
|
|
|
118
115
|
<style>
|
|
119
|
-
|
|
116
|
+
/* .uni-title {
|
|
120
117
|
|
|
121
118
|
} */
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
119
|
+
.uni-title__box {
|
|
120
|
+
/* #ifndef APP-NVUE */
|
|
121
|
+
display: flex;
|
|
122
|
+
/* #endif */
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
align-items: flex-start;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
padding: 8px 0;
|
|
127
|
+
flex: 1;
|
|
128
|
+
}
|
|
132
129
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
130
|
+
.uni-title__base {
|
|
131
|
+
font-size: 15px;
|
|
132
|
+
color: #333;
|
|
133
|
+
font-weight: 500;
|
|
134
|
+
}
|
|
138
135
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
136
|
+
.uni-h1 {
|
|
137
|
+
font-size: 20px;
|
|
138
|
+
color: #333;
|
|
139
|
+
font-weight: bold;
|
|
140
|
+
}
|
|
144
141
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
.uni-h2 {
|
|
143
|
+
font-size: 18px;
|
|
144
|
+
color: #333;
|
|
145
|
+
font-weight: bold;
|
|
146
|
+
}
|
|
150
147
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
148
|
+
.uni-h3 {
|
|
149
|
+
font-size: 16px;
|
|
150
|
+
color: #333;
|
|
151
|
+
font-weight: bold;
|
|
152
|
+
/* font-weight: 400; */
|
|
153
|
+
}
|
|
157
154
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
155
|
+
.uni-h4 {
|
|
156
|
+
font-size: 14px;
|
|
157
|
+
color: #333;
|
|
158
|
+
font-weight: bold;
|
|
159
|
+
/* font-weight: 300; */
|
|
160
|
+
}
|
|
164
161
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
162
|
+
.uni-h5 {
|
|
163
|
+
font-size: 12px;
|
|
164
|
+
color: #333;
|
|
165
|
+
font-weight: bold;
|
|
166
|
+
/* font-weight: 200; */
|
|
167
|
+
}
|
|
171
168
|
</style>
|