@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.
Files changed (146) hide show
  1. package/dist/uni/uni-ui/uni-badge/uni-badge.vue +222 -219
  2. package/dist/uni/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +29 -29
  3. package/dist/uni/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +88 -88
  4. package/dist/uni/uni-ui/uni-calendar/calendar.js +936 -532
  5. package/dist/uni/uni-ui/uni-calendar/i18n/en.json +10 -10
  6. package/dist/uni/uni-ui/uni-calendar/i18n/index.js +8 -7
  7. package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hans.json +10 -10
  8. package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hant.json +10 -10
  9. package/dist/uni/uni-ui/uni-calendar/uni-calendar-item.vue +190 -168
  10. package/dist/uni/uni-ui/uni-calendar/uni-calendar.vue +459 -459
  11. package/dist/uni/uni-ui/uni-calendar/util.js +324 -340
  12. package/dist/uni/uni-ui/uni-card/uni-card.vue +8 -1
  13. package/dist/uni/uni-ui/uni-col/uni-col.vue +294 -287
  14. package/dist/uni/uni-ui/uni-collapse/uni-collapse.vue +139 -140
  15. package/dist/uni/uni-ui/uni-collapse-item/uni-collapse-item.vue +381 -378
  16. package/dist/uni/uni-ui/uni-combox/uni-combox.vue +280 -272
  17. package/dist/uni/uni-ui/uni-countdown/i18n/en.json +4 -4
  18. package/dist/uni/uni-ui/uni-countdown/i18n/index.js +8 -7
  19. package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hans.json +4 -4
  20. package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hant.json +4 -4
  21. package/dist/uni/uni-ui/uni-countdown/uni-countdown.vue +249 -257
  22. package/dist/uni/uni-ui/uni-data-checkbox/uni-data-checkbox.vue +832 -813
  23. package/dist/uni/uni-ui/uni-data-picker/keypress.js +42 -42
  24. package/dist/uni/uni-ui/uni-data-picker/uni-data-picker.vue +535 -516
  25. package/dist/uni/uni-ui/uni-data-pickerview/uni-data-picker.js +623 -618
  26. package/dist/uni/uni-ui/uni-data-pickerview/uni-data-pickerview.vue +293 -288
  27. package/dist/uni/uni-ui/uni-data-select/uni-data-select.vue +495 -509
  28. package/dist/uni/uni-ui/uni-dateformat/date-format.js +181 -184
  29. package/dist/uni/uni-ui/uni-dateformat/uni-dateformat.vue +81 -82
  30. package/dist/uni/uni-ui/uni-datetime-picker/calendar-item.vue +176 -170
  31. package/dist/uni/uni-ui/uni-datetime-picker/calendar.vue +926 -920
  32. package/dist/uni/uni-ui/uni-datetime-picker/i18n/en.json +20 -20
  33. package/dist/uni/uni-ui/uni-datetime-picker/i18n/index.js +8 -7
  34. package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hans.json +21 -21
  35. package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hant.json +21 -21
  36. package/dist/uni/uni-ui/uni-datetime-picker/time-picker.vue +921 -926
  37. package/dist/uni/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +1059 -1012
  38. package/dist/uni/uni-ui/uni-datetime-picker/util.js +366 -377
  39. package/dist/uni/uni-ui/uni-drawer/keypress.js +42 -42
  40. package/dist/uni/uni-ui/uni-drawer/uni-drawer.vue +176 -167
  41. package/dist/uni/uni-ui/uni-easyinput/common.js +40 -42
  42. package/dist/uni/uni-ui/uni-easyinput/uni-easyinput.vue +628 -547
  43. package/dist/uni/uni-ui/uni-fab/uni-fab.vue +507 -483
  44. package/dist/uni/uni-ui/uni-fav/i18n/en.json +2 -2
  45. package/dist/uni/uni-ui/uni-fav/i18n/index.js +8 -7
  46. package/dist/uni/uni-ui/uni-fav/i18n/zh-Hans.json +2 -2
  47. package/dist/uni/uni-ui/uni-fav/i18n/zh-Hant.json +2 -2
  48. package/dist/uni/uni-ui/uni-fav/uni-fav.vue +155 -147
  49. package/dist/uni/uni-ui/uni-file-picker/choose-and-upload-file.js +172 -198
  50. package/dist/uni/uni-ui/uni-file-picker/uni-file-picker.vue +636 -634
  51. package/dist/uni/uni-ui/uni-file-picker/upload-file.vue +294 -293
  52. package/dist/uni/uni-ui/uni-file-picker/upload-image.vue +267 -270
  53. package/dist/uni/uni-ui/uni-file-picker/utils.js +81 -82
  54. package/dist/uni/uni-ui/uni-forms/uni-forms.vue +360 -372
  55. package/dist/uni/uni-ui/uni-forms/utils.js +170 -174
  56. package/dist/uni/uni-ui/uni-forms/validate.js +447 -456
  57. package/dist/uni/uni-ui/uni-forms-item/uni-forms-item.vue +497 -497
  58. package/dist/uni/uni-ui/uni-goods-nav/i18n/en.json +4 -4
  59. package/dist/uni/uni-ui/uni-goods-nav/i18n/index.js +8 -7
  60. package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hans.json +4 -4
  61. package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hant.json +4 -4
  62. package/dist/uni/uni-ui/uni-goods-nav/uni-goods-nav.vue +238 -222
  63. package/dist/uni/uni-ui/uni-grid/uni-grid.vue +134 -134
  64. package/dist/uni/uni-ui/uni-grid-item/uni-grid-item.vue +121 -119
  65. package/dist/uni/uni-ui/uni-group/uni-group.vue +121 -121
  66. package/dist/uni/uni-ui/uni-icons/icons.js +1170 -1168
  67. package/dist/uni/uni-ui/uni-icons/uni-icons.vue +91 -86
  68. package/dist/uni/uni-ui/uni-icons/uniicons.css +166 -166
  69. package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list-item.vue +129 -129
  70. package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list.vue +352 -347
  71. package/dist/uni/uni-ui/uni-link/uni-link.vue +134 -119
  72. package/dist/uni/uni-ui/uni-list/uni-list.vue +119 -110
  73. package/dist/uni/uni-ui/uni-list/uni-refresh.vue +14 -14
  74. package/dist/uni/uni-ui/uni-list/uni-refresh.wxs +14 -14
  75. package/dist/uni/uni-ui/uni-list-ad/uni-list-ad.vue +101 -95
  76. package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.scss +18 -18
  77. package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.vue +602 -586
  78. package/dist/uni/uni-ui/uni-list-item/uni-list-item.vue +507 -503
  79. package/dist/uni/uni-ui/uni-load-more/i18n/en.json +3 -3
  80. package/dist/uni/uni-ui/uni-load-more/i18n/index.js +8 -7
  81. package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hans.json +3 -3
  82. package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hant.json +3 -3
  83. package/dist/uni/uni-ui/uni-load-more/uni-load-more.vue +402 -392
  84. package/dist/uni/uni-ui/uni-nav-bar/uni-nav-bar.vue +328 -330
  85. package/dist/uni/uni-ui/uni-nav-bar/uni-status-bar.vue +17 -17
  86. package/dist/uni/uni-ui/uni-notice-bar/uni-notice-bar.vue +422 -401
  87. package/dist/uni/uni-ui/uni-number-box/uni-number-box.vue +211 -205
  88. package/dist/uni/uni-ui/uni-pagination/i18n/en.json +3 -3
  89. package/dist/uni/uni-ui/uni-pagination/i18n/es.json +3 -3
  90. package/dist/uni/uni-ui/uni-pagination/i18n/fr.json +3 -3
  91. package/dist/uni/uni-ui/uni-pagination/i18n/index.js +12 -11
  92. package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hans.json +3 -3
  93. package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hant.json +3 -3
  94. package/dist/uni/uni-ui/uni-pagination/uni-pagination.vue +450 -433
  95. package/dist/uni/uni-ui/uni-popup/uni-popup.vue +404 -404
  96. package/dist/uni/uni-ui/uni-popup-dialog/keypress.js +42 -42
  97. package/dist/uni/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +1 -0
  98. package/dist/uni/uni-ui/uni-popup-message/uni-popup-message.vue +126 -125
  99. package/dist/uni/uni-ui/uni-popup-share/uni-popup-share.vue +172 -172
  100. package/dist/uni/uni-ui/uni-rate/uni-rate.vue +343 -347
  101. package/dist/uni/uni-ui/uni-row/uni-row.vue +180 -182
  102. package/dist/uni/uni-ui/uni-scss/changelog.md +11 -4
  103. package/dist/uni/uni-ui/uni-scss/package.json +73 -73
  104. package/dist/uni/uni-ui/uni-scss/readme.md +2 -1
  105. package/dist/uni/uni-ui/uni-scss/styles/setting/_border.scss +2 -2
  106. package/dist/uni/uni-ui/uni-scss/styles/setting/_color.scss +46 -47
  107. package/dist/uni/uni-ui/uni-scss/styles/setting/_radius.scss +49 -49
  108. package/dist/uni/uni-ui/uni-scss/styles/setting/_space.scss +52 -53
  109. package/dist/uni/uni-ui/uni-scss/styles/setting/_styles.scss +142 -147
  110. package/dist/uni/uni-ui/uni-scss/styles/setting/_text.scss +20 -20
  111. package/dist/uni/uni-ui/uni-scss/styles/setting/_variables.scss +111 -95
  112. package/dist/uni/uni-ui/uni-scss/styles/tools/functions.scss +28 -18
  113. package/dist/uni/uni-ui/uni-scss/theme.scss +10 -7
  114. package/dist/uni/uni-ui/uni-scss/variables.scss +42 -24
  115. package/dist/uni/uni-ui/uni-search-bar/i18n/en.json +3 -3
  116. package/dist/uni/uni-ui/uni-search-bar/i18n/index.js +8 -7
  117. package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hans.json +2 -2
  118. package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hant.json +2 -2
  119. package/dist/uni/uni-ui/uni-search-bar/uni-search-bar.vue +290 -281
  120. package/dist/uni/uni-ui/uni-section/uni-section.vue +149 -146
  121. package/dist/uni/uni-ui/uni-segmented-control/uni-segmented-control.vue +141 -131
  122. package/dist/uni/uni-ui/uni-steps/uni-steps.vue +255 -236
  123. package/dist/uni/uni-ui/uni-swipe-action/uni-swipe-action.vue +51 -51
  124. package/dist/uni/uni-ui/uni-swipe-action-item/bindingx.js +276 -282
  125. package/dist/uni/uni-ui/uni-swipe-action-item/isPC.js +10 -10
  126. package/dist/uni/uni-ui/uni-swipe-action-item/mpalipay.js +182 -187
  127. package/dist/uni/uni-ui/uni-swipe-action-item/mpother.js +235 -244
  128. package/dist/uni/uni-ui/uni-swipe-action-item/mpwxs.js +70 -75
  129. package/dist/uni/uni-ui/uni-swipe-action-item/render.js +238 -247
  130. package/dist/uni/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +387 -313
  131. package/dist/uni/uni-ui/uni-swipe-action-item/wx.wxs +206 -215
  132. package/dist/uni/uni-ui/uni-swiper-dot/uni-swiper-dot.vue +241 -197
  133. package/dist/uni/uni-ui/uni-table/uni-table.vue +445 -447
  134. package/dist/uni/uni-ui/uni-tag/uni-tag.vue +234 -244
  135. package/dist/uni/uni-ui/uni-tbody/uni-tbody.vue +20 -23
  136. package/dist/uni/uni-ui/uni-td/uni-td.vue +79 -80
  137. package/dist/uni/uni-ui/uni-th/filter-dropdown.vue +510 -503
  138. package/dist/uni/uni-ui/uni-th/uni-th.vue +289 -273
  139. package/dist/uni/uni-ui/uni-thead/uni-thead.vue +115 -114
  140. package/dist/uni/uni-ui/uni-title/uni-title.vue +151 -154
  141. package/dist/uni/uni-ui/uni-tooltip/uni-tooltip.vue +55 -60
  142. package/dist/uni/uni-ui/uni-tr/table-checkbox.vue +162 -163
  143. package/dist/uni/uni-ui/uni-tr/uni-tr.vue +158 -157
  144. package/dist/uni/uni-ui/uni-transition/createAnimation.js +130 -113
  145. package/dist/uni/uni-ui/uni-transition/uni-transition.vue +274 -272
  146. package/package.json +1 -1
@@ -1,128 +1,143 @@
1
1
  <template>
2
- <a v-if="isShowA" class="uni-link" :href="href"
3
- :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}"
4
- :style="{color,fontSize:fontSize+'px'}" :download="download">
5
- <slot>{{text}}</slot>
6
- </a>
7
- <!-- #ifndef APP-NVUE -->
8
- <text v-else class="uni-link" :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}"
9
- :style="{color,fontSize:fontSize+'px'}" @click="openURL">
10
- <slot>{{text}}</slot>
11
- </text>
12
- <!-- #endif -->
13
- <!-- #ifdef APP-NVUE -->
14
- <text v-else class="uni-link" :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}"
15
- :style="{color,fontSize:fontSize+'px'}" @click="openURL">
16
- {{text}}
17
- </text>
18
- <!-- #endif -->
2
+ <a
3
+ v-if="isShowA"
4
+ class="uni-link"
5
+ :href="href"
6
+ :class="{ 'uni-link--withline': showUnderLine === true || showUnderLine === 'true' }"
7
+ :style="{ color, fontSize: fontSize + 'px' }"
8
+ :download="download"
9
+ >
10
+ <slot>{{ text }}</slot>
11
+ </a>
12
+ <!-- #ifndef APP-NVUE -->
13
+ <text
14
+ v-else
15
+ class="uni-link"
16
+ :class="{ 'uni-link--withline': showUnderLine === true || showUnderLine === 'true' }"
17
+ :style="{ color, fontSize: fontSize + 'px' }"
18
+ @click="openURL"
19
+ >
20
+ <slot>{{ text }}</slot>
21
+ </text>
22
+ <!-- #endif -->
23
+ <!-- #ifdef APP-NVUE -->
24
+ <text
25
+ v-else
26
+ class="uni-link"
27
+ :class="{ 'uni-link--withline': showUnderLine === true || showUnderLine === 'true' }"
28
+ :style="{ color, fontSize: fontSize + 'px' }"
29
+ @click="openURL"
30
+ >
31
+ {{ text }}
32
+ </text>
33
+ <!-- #endif -->
19
34
  </template>
20
35
 
21
36
  <script>
22
- /**
23
- * Link 外部网页超链接组件
24
- * @description uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打开新网页
25
- * @tutorial https://ext.dcloud.net.cn/plugin?id=1182
26
- * @property {String} href 点击后打开的外部网页url
27
- * @property {String} text 显示的文字
28
- * @property {String} downlaod H5平台下载文件名
29
- * @property {Boolean} showUnderLine 是否显示下划线
30
- * @property {String} copyTips 在小程序端复制链接时显示的提示语
31
- * @property {String} color 链接文字颜色
32
- * @property {String} fontSize 链接文字大小
33
- * @example * <uni-link href="https://ext.dcloud.net.cn" text="https://ext.dcloud.net.cn"></uni-link>
34
- */
35
- export default {
36
- name: 'uniLink',
37
- props: {
38
- href: {
39
- type: String,
40
- default: ''
41
- },
42
- text: {
43
- type: String,
44
- default: ''
45
- },
46
- download: {
47
- type: String,
48
- default: ''
49
- },
50
- showUnderLine: {
51
- type: [Boolean, String],
52
- default: true
53
- },
54
- copyTips: {
55
- type: String,
56
- default: '已自动复制网址,请在手机浏览器里粘贴该网址'
57
- },
58
- color: {
59
- type: String,
60
- default: '#999999'
61
- },
62
- fontSize: {
63
- type: [Number, String],
64
- default: 14
65
- }
66
- },
67
- computed: {
68
- isShowA() {
69
- // #ifdef H5
70
- this._isH5 = true;
71
- // #endif
72
- if ((this.isMail() || this.isTel()) && this._isH5 === true) {
73
- return true;
74
- }
75
- return false;
76
- }
77
- },
78
- created() {
79
- this._isH5 = null;
80
- },
81
- methods: {
82
- isMail() {
83
- return this.href.startsWith('mailto:');
84
- },
85
- isTel() {
86
- return this.href.startsWith('tel:');
87
- },
88
- openURL() {
89
- // #ifdef APP-PLUS
90
- if (this.isTel()) {
91
- this.makePhoneCall(this.href.replace('tel:', ''));
92
- } else {
93
- plus.runtime.openURL(this.href);
94
- }
95
- // #endif
96
- // #ifdef H5
97
- window.open(this.href)
98
- // #endif
99
- // #ifdef MP
100
- uni.setClipboardData({
101
- data: this.href
102
- });
103
- uni.showModal({
104
- content: this.copyTips,
105
- showCancel: false
106
- });
107
- // #endif
108
- },
109
- makePhoneCall(phoneNumber) {
110
- uni.makePhoneCall({
111
- phoneNumber
112
- })
113
- }
114
- }
115
- }
37
+ /**
38
+ * Link 外部网页超链接组件
39
+ * @description uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打开新网页
40
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=1182
41
+ * @property {String} href 点击后打开的外部网页url
42
+ * @property {String} text 显示的文字
43
+ * @property {String} downlaod H5平台下载文件名
44
+ * @property {Boolean} showUnderLine 是否显示下划线
45
+ * @property {String} copyTips 在小程序端复制链接时显示的提示语
46
+ * @property {String} color 链接文字颜色
47
+ * @property {String} fontSize 链接文字大小
48
+ * @example * <uni-link href="https://ext.dcloud.net.cn" text="https://ext.dcloud.net.cn"></uni-link>
49
+ */
50
+ export default {
51
+ name: 'uniLink',
52
+ props: {
53
+ href: {
54
+ type: String,
55
+ default: '',
56
+ },
57
+ text: {
58
+ type: String,
59
+ default: '',
60
+ },
61
+ download: {
62
+ type: String,
63
+ default: '',
64
+ },
65
+ showUnderLine: {
66
+ type: [Boolean, String],
67
+ default: true,
68
+ },
69
+ copyTips: {
70
+ type: String,
71
+ default: '已自动复制网址,请在手机浏览器里粘贴该网址',
72
+ },
73
+ color: {
74
+ type: String,
75
+ default: '#999999',
76
+ },
77
+ fontSize: {
78
+ type: [Number, String],
79
+ default: 14,
80
+ },
81
+ },
82
+ computed: {
83
+ isShowA() {
84
+ // #ifdef H5
85
+ this._isH5 = true;
86
+ // #endif
87
+ if ((this.isMail() || this.isTel()) && this._isH5 === true) {
88
+ return true;
89
+ }
90
+ return false;
91
+ },
92
+ },
93
+ created() {
94
+ this._isH5 = null;
95
+ },
96
+ methods: {
97
+ isMail() {
98
+ return this.href.startsWith('mailto:');
99
+ },
100
+ isTel() {
101
+ return this.href.startsWith('tel:');
102
+ },
103
+ openURL() {
104
+ // #ifdef APP-PLUS
105
+ if (this.isTel()) {
106
+ this.makePhoneCall(this.href.replace('tel:', ''));
107
+ } else {
108
+ plus.runtime.openURL(this.href);
109
+ }
110
+ // #endif
111
+ // #ifdef H5
112
+ window.open(this.href);
113
+ // #endif
114
+ // #ifdef MP
115
+ uni.setClipboardData({
116
+ data: this.href,
117
+ });
118
+ uni.showModal({
119
+ content: this.copyTips,
120
+ showCancel: false,
121
+ });
122
+ // #endif
123
+ },
124
+ makePhoneCall(phoneNumber) {
125
+ uni.makePhoneCall({
126
+ phoneNumber,
127
+ });
128
+ },
129
+ },
130
+ };
116
131
  </script>
117
132
 
118
133
  <style>
119
- /* #ifndef APP-NVUE */
120
- .uni-link {
121
- cursor: pointer;
122
- }
134
+ /* #ifndef APP-NVUE */
135
+ .uni-link {
136
+ cursor: pointer;
137
+ }
123
138
 
124
- /* #endif */
125
- .uni-link--withline {
126
- text-decoration: underline;
127
- }
139
+ /* #endif */
140
+ .uni-link--withline {
141
+ text-decoration: underline;
142
+ }
128
143
  </style>
@@ -1,123 +1,132 @@
1
1
  <template>
2
- <!-- #ifndef APP-NVUE -->
3
- <view class="uni-list uni-border-top-bottom">
4
- <view v-if="border" class="uni-list--border-top"></view>
5
- <slot />
6
- <view v-if="border" class="uni-list--border-bottom"></view>
7
- </view>
8
- <!-- #endif -->
9
- <!-- #ifdef APP-NVUE -->
10
- <list :bounce="false" :scrollable="true" show-scrollbar :render-reverse="renderReverse" @scroll="scroll" class="uni-list" :class="{ 'uni-list--border': border }" :enableBackToTop="enableBackToTop"
11
- loadmoreoffset="15">
12
- <slot />
13
- </list>
14
- <!-- #endif -->
2
+ <!-- #ifndef APP-NVUE -->
3
+ <view class="uni-list uni-border-top-bottom">
4
+ <view v-if="border" class="uni-list--border-top"></view>
5
+ <slot />
6
+ <view v-if="border" class="uni-list--border-bottom"></view>
7
+ </view>
8
+ <!-- #endif -->
9
+ <!-- #ifdef APP-NVUE -->
10
+ <list
11
+ :bounce="false"
12
+ :scrollable="true"
13
+ show-scrollbar
14
+ :render-reverse="renderReverse"
15
+ @scroll="scroll"
16
+ class="uni-list"
17
+ :class="{ 'uni-list--border': border }"
18
+ :enableBackToTop="enableBackToTop"
19
+ loadmoreoffset="15"
20
+ >
21
+ <slot />
22
+ </list>
23
+ <!-- #endif -->
15
24
  </template>
16
25
 
17
26
  <script>
18
- /**
19
- * List 列表
20
- * @description 列表组件
21
- * @tutorial https://ext.dcloud.net.cn/plugin?id=24
22
- * @property {String} border = [true|false] 标题
23
- */
24
- export default {
25
- name: 'UniList',
26
- 'mp-weixin': {
27
- options: {
28
- multipleSlots: false
29
- }
30
- },
31
- props: {
32
- stackFromEnd:{
33
- type: Boolean,
34
- default:false
35
- },
36
- enableBackToTop: {
37
- type: [Boolean, String],
38
- default: false
39
- },
40
- scrollY: {
41
- type: [Boolean, String],
42
- default: false
43
- },
44
- border: {
45
- type: Boolean,
46
- default: true
47
- },
48
- renderReverse:{
49
- type: Boolean,
50
- default: false
51
- }
52
- },
53
- // provide() {
54
- // return {
55
- // list: this
56
- // };
57
- // },
58
- created() {
59
- this.firstChildAppend = false;
60
- },
61
- methods: {
62
- loadMore(e) {
63
- this.$emit('scrolltolower');
64
- },
65
- scroll(e) {
66
- this.$emit('scroll', e);
67
- }
68
- }
69
- };
27
+ /**
28
+ * List 列表
29
+ * @description 列表组件
30
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=24
31
+ * @property {String} border = [true|false] 标题
32
+ */
33
+ export default {
34
+ name: 'UniList',
35
+ 'mp-weixin': {
36
+ options: {
37
+ multipleSlots: false,
38
+ },
39
+ },
40
+ props: {
41
+ stackFromEnd: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
45
+ enableBackToTop: {
46
+ type: [Boolean, String],
47
+ default: false,
48
+ },
49
+ scrollY: {
50
+ type: [Boolean, String],
51
+ default: false,
52
+ },
53
+ border: {
54
+ type: Boolean,
55
+ default: true,
56
+ },
57
+ renderReverse: {
58
+ type: Boolean,
59
+ default: false,
60
+ },
61
+ },
62
+ // provide() {
63
+ // return {
64
+ // list: this
65
+ // };
66
+ // },
67
+ created() {
68
+ this.firstChildAppend = false;
69
+ },
70
+ methods: {
71
+ loadMore(e) {
72
+ this.$emit('scrolltolower');
73
+ },
74
+ scroll(e) {
75
+ this.$emit('scroll', e);
76
+ },
77
+ },
78
+ };
70
79
  </script>
71
80
  <style lang="scss">
72
- $uni-bg-color:#ffffff;
73
- $uni-border-color:#e5e5e5;
81
+ $uni-bg-color: #ffffff;
82
+ $uni-border-color: #e5e5e5;
74
83
 
75
- .uni-list {
76
- /* #ifndef APP-NVUE */
77
- display: flex;
78
- /* #endif */
79
- background-color: $uni-bg-color;
80
- position: relative;
81
- flex-direction: column;
82
- }
84
+ .uni-list {
85
+ /* #ifndef APP-NVUE */
86
+ display: flex;
87
+ /* #endif */
88
+ background-color: $uni-bg-color;
89
+ position: relative;
90
+ flex-direction: column;
91
+ }
83
92
 
84
- .uni-list--border {
85
- position: relative;
86
- /* #ifdef APP-NVUE */
87
- border-top-color: $uni-border-color;
88
- border-top-style: solid;
89
- border-top-width: 0.5px;
90
- border-bottom-color: $uni-border-color;
91
- border-bottom-style: solid;
92
- border-bottom-width: 0.5px;
93
- /* #endif */
94
- z-index: -1;
95
- }
93
+ .uni-list--border {
94
+ position: relative;
95
+ /* #ifdef APP-NVUE */
96
+ border-top-color: $uni-border-color;
97
+ border-top-style: solid;
98
+ border-top-width: 0.5px;
99
+ border-bottom-color: $uni-border-color;
100
+ border-bottom-style: solid;
101
+ border-bottom-width: 0.5px;
102
+ /* #endif */
103
+ z-index: -1;
104
+ }
96
105
 
97
- /* #ifndef APP-NVUE */
106
+ /* #ifndef APP-NVUE */
98
107
 
99
- .uni-list--border-top {
100
- position: absolute;
101
- top: 0;
102
- right: 0;
103
- left: 0;
104
- height: 1px;
105
- -webkit-transform: scaleY(0.5);
106
- transform: scaleY(0.5);
107
- background-color: $uni-border-color;
108
- z-index: 1;
109
- }
108
+ .uni-list--border-top {
109
+ position: absolute;
110
+ top: 0;
111
+ right: 0;
112
+ left: 0;
113
+ height: 1px;
114
+ -webkit-transform: scaleY(0.5);
115
+ transform: scaleY(0.5);
116
+ background-color: $uni-border-color;
117
+ z-index: 1;
118
+ }
110
119
 
111
- .uni-list--border-bottom {
112
- position: absolute;
113
- bottom: 0;
114
- right: 0;
115
- left: 0;
116
- height: 1px;
117
- -webkit-transform: scaleY(0.5);
118
- transform: scaleY(0.5);
119
- background-color: $uni-border-color;
120
- }
120
+ .uni-list--border-bottom {
121
+ position: absolute;
122
+ bottom: 0;
123
+ right: 0;
124
+ left: 0;
125
+ height: 1px;
126
+ -webkit-transform: scaleY(0.5);
127
+ transform: scaleY(0.5);
128
+ background-color: $uni-border-color;
129
+ }
121
130
 
122
- /* #endif */
131
+ /* #endif */
123
132
  </style>
@@ -17,21 +17,21 @@
17
17
  props: {
18
18
  display: {
19
19
  type: [String],
20
- default: "hide"
21
- }
20
+ default: 'hide',
21
+ },
22
22
  },
23
23
  data() {
24
24
  return {
25
- pulling: false
26
- }
25
+ pulling: false,
26
+ };
27
27
  },
28
28
  computed: {
29
29
  isShow() {
30
- if (this.display === "show" || this.pulling === true) {
30
+ if (this.display === 'show' || this.pulling === true) {
31
31
  return true;
32
32
  }
33
33
  return false;
34
- }
34
+ },
35
35
  },
36
36
  created() {},
37
37
  methods: {
@@ -39,22 +39,22 @@
39
39
  this.pulling = value;
40
40
  },
41
41
  onrefresh(e) {
42
- this.$emit("refresh", e);
42
+ this.$emit('refresh', e);
43
43
  },
44
44
  onpullingdown(e) {
45
45
  // #ifdef APP-NVUE
46
- this.$emit("pullingdown", e);
46
+ this.$emit('pullingdown', e);
47
47
  // #endif
48
48
  // #ifndef APP-NVUE
49
49
  var detail = {
50
50
  viewHeight: 90,
51
- pullingDistance: e.height
52
- }
53
- this.$emit("pullingdown", detail);
51
+ pullingDistance: e.height,
52
+ };
53
+ this.$emit('pullingdown', detail);
54
54
  // #endif
55
- }
56
- }
57
- }
55
+ },
56
+ },
57
+ };
58
58
  </script>
59
59
 
60
60
  <style>
@@ -3,11 +3,11 @@ var pullDown = {
3
3
  maxHeight: 200,
4
4
  callRefresh: 'onrefresh',
5
5
  callPullingDown: 'onpullingdown',
6
- refreshSelector: '.uni-refresh'
6
+ refreshSelector: '.uni-refresh',
7
7
  };
8
8
 
9
9
  function ready(newValue, oldValue, ownerInstance, instance) {
10
- var state = instance.getState()
10
+ var state = instance.getState();
11
11
  state.canPullDown = newValue;
12
12
  // console.log(newValue);
13
13
  }
@@ -15,9 +15,9 @@ function ready(newValue, oldValue, ownerInstance, instance) {
15
15
  function touchStart(e, instance) {
16
16
  var state = instance.getState();
17
17
  state.refreshInstance = instance.selectComponent(pullDown.refreshSelector);
18
- state.canPullDown = (state.refreshInstance != null && state.refreshInstance != undefined);
18
+ state.canPullDown = state.refreshInstance != null && state.refreshInstance != undefined;
19
19
  if (!state.canPullDown) {
20
- return
20
+ return;
21
21
  }
22
22
 
23
23
  // console.log("touchStart");
@@ -25,16 +25,16 @@ function touchStart(e, instance) {
25
25
  state.height = 0;
26
26
  state.touchStartY = e.touches[0].pageY || e.changedTouches[0].pageY;
27
27
  state.refreshInstance.setStyle({
28
- 'height': 0
28
+ height: 0,
29
29
  });
30
- state.refreshInstance.callMethod("onchange", true);
30
+ state.refreshInstance.callMethod('onchange', true);
31
31
  }
32
32
 
33
33
  function touchMove(e, ownerInstance) {
34
34
  var instance = e.instance;
35
35
  var state = instance.getState();
36
36
  if (!state.canPullDown) {
37
- return
37
+ return;
38
38
  }
39
39
 
40
40
  var oldHeight = state.height;
@@ -46,23 +46,23 @@ function touchMove(e, ownerInstance) {
46
46
 
47
47
  var refreshInstance = state.refreshInstance;
48
48
  refreshInstance.setStyle({
49
- 'height': height + 'px'
49
+ height: height + 'px',
50
50
  });
51
51
 
52
52
  height = height < pullDown.maxHeight ? height : pullDown.maxHeight;
53
53
  state.height = height;
54
54
  refreshInstance.callMethod(pullDown.callPullingDown, {
55
- height: height
55
+ height: height,
56
56
  });
57
57
  }
58
58
 
59
59
  function touchEnd(e, ownerInstance) {
60
60
  var state = e.instance.getState();
61
61
  if (!state.canPullDown) {
62
- return
62
+ return;
63
63
  }
64
64
 
65
- state.refreshInstance.callMethod("onchange", false);
65
+ state.refreshInstance.callMethod('onchange', false);
66
66
 
67
67
  var refreshInstance = state.refreshInstance;
68
68
  if (state.height > pullDown.threshold) {
@@ -71,7 +71,7 @@ function touchEnd(e, ownerInstance) {
71
71
  }
72
72
 
73
73
  refreshInstance.setStyle({
74
- 'height': 0
74
+ height: 0,
75
75
  });
76
76
  }
77
77
 
@@ -83,5 +83,5 @@ module.exports = {
83
83
  touchmove: touchMove,
84
84
  touchstart: touchStart,
85
85
  touchend: touchEnd,
86
- propObserver: propObserver
87
- }
86
+ propObserver: propObserver,
87
+ };