uview-plus 3.2.24 → 3.3.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/changelog.md +27 -0
- package/components/u--form/u--form.vue +3 -3
- package/components/u--image/u--image.vue +3 -3
- package/components/u--input/u--input.vue +3 -3
- package/components/u--text/u--text.vue +4 -4
- package/components/u--textarea/u--textarea.vue +3 -3
- package/components/u-action-sheet/props.js +5 -3
- package/components/u-action-sheet/u-action-sheet.vue +6 -6
- package/components/u-album/props.js +4 -3
- package/components/u-album/u-album.vue +3 -3
- package/components/u-alert/props.js +4 -3
- package/components/u-alert/u-alert.vue +3 -3
- package/components/u-avatar/props.js +4 -3
- package/components/u-avatar/u-avatar.vue +3 -3
- package/components/u-avatar-group/props.js +4 -3
- package/components/u-avatar-group/u-avatar-group.vue +3 -3
- package/components/u-back-top/props.js +4 -3
- package/components/u-back-top/u-back-top.vue +3 -3
- package/components/u-badge/props.js +4 -3
- package/components/u-badge/u-badge.vue +3 -3
- package/components/u-button/props.js +4 -3
- package/components/u-button/u-button.vue +6 -6
- package/components/u-calendar/header.vue +2 -2
- package/components/u-calendar/month.vue +2 -2
- package/components/u-calendar/props.js +5 -3
- package/components/u-calendar/u-calendar.vue +3 -3
- package/components/u-car-keyboard/props.js +5 -3
- package/components/u-car-keyboard/u-car-keyboard.vue +3 -3
- package/components/u-cell/props.js +4 -3
- package/components/u-cell/u-cell.vue +5 -3
- package/components/u-cell-group/props.js +4 -3
- package/components/u-cell-group/u-cell-group.vue +3 -3
- package/components/u-checkbox/props.js +4 -3
- package/components/u-checkbox/u-checkbox.vue +13 -11
- package/components/u-checkbox-group/props.js +5 -4
- package/components/u-checkbox-group/u-checkbox-group.vue +3 -3
- package/components/u-circle-progress/props.js +4 -3
- package/components/u-circle-progress/u-circle-progress.vue +3 -3
- package/components/u-code/props.js +4 -3
- package/components/u-code/u-code.vue +3 -3
- package/components/u-code-input/props.js +4 -3
- package/components/u-code-input/u-code-input.vue +3 -3
- package/components/u-col/props.js +4 -3
- package/components/u-col/u-col.vue +3 -3
- package/components/u-collapse/props.js +4 -3
- package/components/u-collapse/u-collapse.vue +3 -3
- package/components/u-collapse-item/props.js +4 -3
- package/components/u-collapse-item/u-collapse-item.vue +3 -3
- package/components/u-column-notice/props.js +4 -3
- package/components/u-column-notice/u-column-notice.vue +3 -3
- package/components/u-count-down/props.js +4 -3
- package/components/u-count-down/u-count-down.vue +3 -3
- package/components/u-count-to/props.js +4 -3
- package/components/u-count-to/u-count-to.vue +3 -3
- package/components/u-datetime-picker/props.js +4 -3
- package/components/u-datetime-picker/u-datetime-picker.vue +5 -5
- package/components/u-divider/props.js +4 -3
- package/components/u-divider/u-divider.vue +3 -3
- package/components/u-dropdown/props.js +4 -3
- package/components/u-dropdown/u-dropdown.vue +3 -3
- package/components/u-dropdown-item/props.js +4 -3
- package/components/u-dropdown-item/u-dropdown-item.vue +3 -3
- package/components/u-empty/props.js +4 -3
- package/components/u-empty/u-empty.vue +3 -3
- package/components/u-form/props.js +4 -3
- package/components/u-form/u-form.vue +3 -3
- package/components/u-form-item/props.js +4 -3
- package/components/u-form-item/u-form-item.vue +4 -4
- package/components/u-gap/props.js +4 -3
- package/components/u-gap/u-gap.vue +3 -3
- package/components/u-grid/props.js +4 -3
- package/components/u-grid/u-grid.vue +3 -3
- package/components/u-grid-item/props.js +4 -3
- package/components/u-grid-item/u-grid-item.vue +3 -3
- package/components/u-icon/props.js +4 -3
- package/components/u-icon/u-icon.vue +3 -3
- package/components/u-image/props.js +4 -3
- package/components/u-image/u-image.vue +3 -3
- package/components/u-index-anchor/props.js +4 -3
- package/components/u-index-anchor/u-index-anchor.vue +3 -3
- package/components/u-index-item/props.js +5 -3
- package/components/u-index-item/u-index-item.vue +3 -3
- package/components/u-index-list/props.js +4 -3
- package/components/u-index-list/u-index-list.vue +3 -3
- package/components/u-input/props.js +5 -3
- package/components/u-input/u-input.vue +35 -50
- package/components/u-keyboard/props.js +4 -3
- package/components/u-keyboard/u-keyboard.vue +3 -3
- package/components/u-line/props.js +4 -3
- package/components/u-line/u-line.vue +3 -3
- package/components/u-line-progress/props.js +4 -3
- package/components/u-line-progress/u-line-progress.vue +3 -3
- package/components/u-link/props.js +4 -3
- package/components/u-link/u-link.vue +3 -3
- package/components/u-list/props.js +5 -4
- package/components/u-list/u-list.vue +3 -3
- package/components/u-list-item/props.js +4 -3
- package/components/u-list-item/u-list-item.vue +3 -3
- package/components/u-loading-icon/props.js +4 -3
- package/components/u-loading-icon/u-loading-icon.vue +3 -3
- package/components/u-loading-page/props.js +5 -3
- package/components/u-loading-page/u-loading-page.vue +3 -3
- package/components/u-loadmore/props.js +4 -3
- package/components/u-loadmore/u-loadmore.vue +3 -3
- package/components/u-modal/props.js +4 -3
- package/components/u-modal/u-modal.vue +4 -3
- package/components/u-navbar/props.js +5 -3
- package/components/u-navbar/u-navbar.vue +4 -4
- package/components/u-no-network/props.js +4 -3
- package/components/u-no-network/u-no-network.vue +3 -3
- package/components/u-notice-bar/props.js +4 -3
- package/components/u-notice-bar/u-notice-bar.vue +3 -3
- package/components/u-notify/props.js +4 -3
- package/components/u-notify/u-notify.vue +4 -4
- package/components/u-number-box/props.js +4 -3
- package/components/u-number-box/u-number-box.vue +3 -3
- package/components/u-number-keyboard/props.js +4 -3
- package/components/u-number-keyboard/u-number-keyboard.vue +3 -3
- package/components/u-overlay/props.js +4 -3
- package/components/u-overlay/u-overlay.vue +3 -3
- package/components/u-parse/props.js +3 -2
- package/components/u-picker/props.js +4 -3
- package/components/u-picker/u-picker.vue +3 -3
- package/components/u-picker-column/props.js +3 -2
- package/components/u-picker-column/u-picker-column.vue +3 -3
- package/components/u-popup/props.js +4 -3
- package/components/u-popup/u-popup.vue +4 -4
- package/components/u-radio/props.js +4 -3
- package/components/u-radio/u-radio.vue +3 -3
- package/components/u-radio-group/props.js +4 -3
- package/components/u-radio-group/u-radio-group.vue +3 -3
- package/components/u-rate/props.js +4 -3
- package/components/u-rate/u-rate.vue +3 -3
- package/components/u-read-more/props.js +4 -3
- package/components/u-read-more/u-read-more.vue +4 -3
- package/components/u-row/props.js +4 -3
- package/components/u-row/u-row.vue +3 -3
- package/components/u-row-notice/props.js +4 -3
- package/components/u-row-notice/u-row-notice.vue +4 -3
- package/components/u-safe-bottom/props.js +5 -4
- package/components/u-safe-bottom/u-safe-bottom.vue +3 -3
- package/components/u-scroll-list/props.js +4 -3
- package/components/u-scroll-list/u-scroll-list.vue +3 -3
- package/components/u-search/props.js +4 -3
- package/components/u-search/u-search.vue +3 -3
- package/components/u-skeleton/props.js +4 -3
- package/components/u-skeleton/u-skeleton.vue +3 -3
- package/components/u-slider/props.js +4 -3
- package/components/u-slider/u-slider.vue +3 -3
- package/components/u-status-bar/props.js +4 -3
- package/components/u-status-bar/u-status-bar.vue +3 -3
- package/components/u-steps/props.js +4 -3
- package/components/u-steps/u-steps.vue +3 -3
- package/components/u-steps-item/props.js +4 -3
- package/components/u-steps-item/u-steps-item.vue +3 -3
- package/components/u-sticky/props.js +4 -3
- package/components/u-sticky/u-sticky.vue +3 -3
- package/components/u-subsection/props.js +4 -3
- package/components/u-subsection/u-subsection.vue +3 -3
- package/components/u-swipe-action/props.js +4 -3
- package/components/u-swipe-action/u-swipe-action.vue +3 -3
- package/components/u-swipe-action-item/props.js +4 -3
- package/components/u-swipe-action-item/u-swipe-action-item.vue +5 -5
- package/components/u-swiper/props.js +4 -3
- package/components/u-swiper/u-swiper.vue +3 -3
- package/components/u-swiper-indicator/props.js +4 -3
- package/components/u-swiper-indicator/u-swiper-indicator.vue +3 -3
- package/components/u-switch/props.js +4 -3
- package/components/u-switch/u-switch.vue +3 -3
- package/components/u-tabbar/props.js +5 -3
- package/components/u-tabbar/u-tabbar.vue +3 -3
- package/components/u-tabbar-item/props.js +4 -3
- package/components/u-tabbar-item/u-tabbar-item.vue +7 -4
- package/components/u-table/props.js +3 -2
- package/components/u-table/u-table.vue +3 -3
- package/components/u-tabs/props.js +4 -3
- package/components/u-tabs/u-tabs.vue +5 -5
- package/components/u-tabs-item/props.js +3 -2
- package/components/u-tabs-item/u-tabs-item.vue +3 -3
- package/components/u-tag/props.js +4 -3
- package/components/u-tag/u-tag.vue +8 -4
- package/components/u-td/props.js +3 -2
- package/components/u-td/u-td.vue +3 -3
- package/components/u-text/props.js +4 -3
- package/components/u-text/u-text.vue +8 -8
- package/components/u-textarea/props.js +5 -3
- package/components/u-textarea/u-textarea.vue +3 -3
- package/components/u-toast/u-toast.vue +2 -2
- package/components/u-toolbar/props.js +4 -3
- package/components/u-toolbar/u-toolbar.vue +3 -3
- package/components/u-tooltip/props.js +4 -3
- package/components/u-tooltip/u-tooltip.vue +3 -3
- package/components/u-tr/props.js +3 -2
- package/components/u-tr/u-tr.vue +3 -3
- package/components/u-transition/props.js +4 -3
- package/components/u-transition/u-transition.vue +3 -3
- package/components/u-upload/mixin.js +3 -2
- package/components/u-upload/props.js +8 -3
- package/components/u-upload/u-upload.vue +6 -5
- package/components/u-upload/utils.js +55 -46
- package/index.js +2 -2
- package/libs/config/props/upload.js +1 -0
- package/libs/mixin/button.js +4 -2
- package/libs/mixin/mixin.js +9 -5
- package/libs/mixin/mpMixin.js +4 -2
- package/libs/mixin/mpShare.js +5 -2
- package/libs/mixin/openType.js +4 -2
- package/libs/mixin/style.js +5 -3
- package/libs/mixin/touch.js +4 -2
- package/libs/vue.js +3 -0
- package/package.json +1 -1
- package/types/comps/popup.d.ts +1 -1
package/components/u-tr/props.js
CHANGED
package/components/u-tr/u-tr.vue
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
|
-
import props from './props';
|
|
9
|
-
import mpMixin from '../../libs/mixin/mpMixin';
|
|
10
|
-
import mixin from '../../libs/mixin/mixin';
|
|
8
|
+
import { props } from './props';
|
|
9
|
+
import { mpMixin } from '../../libs/mixin/mpMixin';
|
|
10
|
+
import { mixin } from '../../libs/mixin/mixin';
|
|
11
11
|
/**
|
|
12
12
|
* Tr
|
|
13
13
|
* @description
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { defineMixin } from '../../libs/vue'
|
|
2
|
+
import defProps from '../../libs/config/props.js'
|
|
3
|
+
export const props = defineMixin({
|
|
3
4
|
props: {
|
|
4
5
|
// 是否展示组件
|
|
5
6
|
show: {
|
|
@@ -22,4 +23,4 @@ export default {
|
|
|
22
23
|
default: () => defProps.transition.timingFunction
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
|
-
}
|
|
26
|
+
})
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<script>
|
|
16
|
-
import props from './props';
|
|
17
|
-
import mpMixin from '../../libs/mixin/mpMixin';
|
|
18
|
-
import mixin from '../../libs/mixin/mixin';
|
|
16
|
+
import { props } from './props';
|
|
17
|
+
import { mpMixin } from '../../libs/mixin/mpMixin';
|
|
18
|
+
import { mixin } from '../../libs/mixin/mixin';
|
|
19
19
|
import { addStyle } from '../../libs/function/index';
|
|
20
20
|
// 组件的methods方法,由于内容较长,写在外部文件中通过mixin引入
|
|
21
21
|
import transition from "./transition.js";
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { defineMixin } from '../../libs/vue'
|
|
2
|
+
import defProps from '../../libs/config/props.js'
|
|
3
|
+
export const props = defineMixin({
|
|
3
4
|
props: {
|
|
4
5
|
// 接受的文件类型, 可选值为all media image file video
|
|
5
6
|
accept: {
|
|
6
7
|
type: String,
|
|
7
8
|
default: () => defProps.upload.accept
|
|
8
9
|
},
|
|
10
|
+
extension: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: () => defProps.upload.extension
|
|
13
|
+
},
|
|
9
14
|
// 图片或视频拾取模式,当accept为image类型时设置capture可选额外camera可以直接调起摄像头
|
|
10
15
|
capture: {
|
|
11
16
|
type: [String, Array],
|
|
@@ -122,4 +127,4 @@ export default {
|
|
|
122
127
|
default: () => defProps.upload.previewImage
|
|
123
128
|
}
|
|
124
129
|
}
|
|
125
|
-
}
|
|
130
|
+
})
|
|
@@ -131,10 +131,10 @@
|
|
|
131
131
|
import {
|
|
132
132
|
chooseFile
|
|
133
133
|
} from './utils';
|
|
134
|
-
import
|
|
135
|
-
import props from './props';
|
|
136
|
-
import mpMixin from '../../libs/mixin/mpMixin';
|
|
137
|
-
import mixin from '../../libs/mixin/mixin';
|
|
134
|
+
import { mixinUpload } from './mixin';
|
|
135
|
+
import { props } from './props';
|
|
136
|
+
import { mpMixin } from '../../libs/mixin/mpMixin';
|
|
137
|
+
import { mixin } from '../../libs/mixin/mixin';
|
|
138
138
|
import { addStyle, addUnit, toast } from '../../libs/function/index';
|
|
139
139
|
import test from '../../libs/function/test';
|
|
140
140
|
/**
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
*/
|
|
173
173
|
export default {
|
|
174
174
|
name: "u-upload",
|
|
175
|
-
mixins: [mpMixin, mixin,
|
|
175
|
+
mixins: [mpMixin, mixin, mixinUpload, props],
|
|
176
176
|
data() {
|
|
177
177
|
return {
|
|
178
178
|
// #ifdef APP-NVUE
|
|
@@ -231,6 +231,7 @@
|
|
|
231
231
|
chooseFile(
|
|
232
232
|
Object.assign({
|
|
233
233
|
accept: this.accept,
|
|
234
|
+
extension: this.extension,
|
|
234
235
|
multiple: this.multiple,
|
|
235
236
|
capture: capture,
|
|
236
237
|
compressed: this.compressed,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function pickExclude(obj, keys) {
|
|
1
|
+
function pickExclude(obj, keys) {
|
|
2
2
|
// 某些情况下,type可能会为
|
|
3
3
|
if (!['[object Object]', '[object File]'].includes(Object.prototype.toString.call(obj))) {
|
|
4
4
|
return {}
|
|
@@ -12,52 +12,52 @@ function pickExclude(obj, keys) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
function formatImage(res) {
|
|
15
|
-
return res.tempFiles.map((item) => ({
|
|
16
|
-
...pickExclude(item, ['path']),
|
|
15
|
+
return res.tempFiles.map((item) => ({
|
|
16
|
+
...pickExclude(item, ['path']),
|
|
17
17
|
type: 'image',
|
|
18
18
|
url: item.path,
|
|
19
|
-
thumb: item.path,
|
|
20
|
-
size: item.size,
|
|
21
|
-
// #ifdef H5
|
|
22
|
-
name: item.name
|
|
23
|
-
// #endif
|
|
19
|
+
thumb: item.path,
|
|
20
|
+
size: item.size,
|
|
21
|
+
// #ifdef H5
|
|
22
|
+
name: item.name
|
|
23
|
+
// #endif
|
|
24
24
|
}))
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
function formatVideo(res) {
|
|
28
28
|
return [
|
|
29
|
-
{
|
|
30
|
-
...pickExclude(res, ['tempFilePath', 'thumbTempFilePath', 'errMsg']),
|
|
29
|
+
{
|
|
30
|
+
...pickExclude(res, ['tempFilePath', 'thumbTempFilePath', 'errMsg']),
|
|
31
31
|
type: 'video',
|
|
32
32
|
url: res.tempFilePath,
|
|
33
|
-
thumb: res.thumbTempFilePath,
|
|
34
|
-
size: res.size,
|
|
35
|
-
// #ifdef H5
|
|
36
|
-
name: res.name
|
|
37
|
-
// #endif
|
|
33
|
+
thumb: res.thumbTempFilePath,
|
|
34
|
+
size: res.size,
|
|
35
|
+
// #ifdef H5
|
|
36
|
+
name: res.name
|
|
37
|
+
// #endif
|
|
38
38
|
}
|
|
39
39
|
]
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
function formatMedia(res) {
|
|
43
|
-
return res.tempFiles.map((item) => ({
|
|
44
|
-
...pickExclude(item, ['fileType', 'thumbTempFilePath', 'tempFilePath']),
|
|
43
|
+
return res.tempFiles.map((item) => ({
|
|
44
|
+
...pickExclude(item, ['fileType', 'thumbTempFilePath', 'tempFilePath']),
|
|
45
45
|
type: res.type,
|
|
46
46
|
url: item.tempFilePath,
|
|
47
|
-
thumb: res.type === 'video' ? item.thumbTempFilePath : item.tempFilePath,
|
|
48
|
-
size: item.size
|
|
47
|
+
thumb: res.type === 'video' ? item.thumbTempFilePath : item.tempFilePath,
|
|
48
|
+
size: item.size
|
|
49
49
|
}))
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
function formatFile(res) {
|
|
53
|
-
return res.tempFiles.map((item) => ({
|
|
54
|
-
...pickExclude(item, ['path']),
|
|
55
|
-
url: item.path,
|
|
56
|
-
size:item.size,
|
|
53
|
+
return res.tempFiles.map((item) => ({
|
|
54
|
+
...pickExclude(item, ['path']),
|
|
55
|
+
url: item.path,
|
|
56
|
+
size:item.size,
|
|
57
57
|
// #ifdef H5
|
|
58
58
|
name: item.name,
|
|
59
59
|
type: item.type
|
|
60
|
-
// #endif
|
|
60
|
+
// #endif
|
|
61
61
|
}))
|
|
62
62
|
}
|
|
63
63
|
export function chooseFile({
|
|
@@ -68,7 +68,8 @@ export function chooseFile({
|
|
|
68
68
|
maxDuration,
|
|
69
69
|
sizeType,
|
|
70
70
|
camera,
|
|
71
|
-
maxCount
|
|
71
|
+
maxCount,
|
|
72
|
+
extension
|
|
72
73
|
}) {
|
|
73
74
|
return new Promise((resolve, reject) => {
|
|
74
75
|
switch (accept) {
|
|
@@ -118,33 +119,41 @@ export function chooseFile({
|
|
|
118
119
|
// #endif
|
|
119
120
|
// #ifdef H5
|
|
120
121
|
// 需要hx2.9.9以上才支持uni.chooseFile
|
|
121
|
-
|
|
122
|
+
let params = {
|
|
122
123
|
count: multiple ? maxCount : 1,
|
|
123
124
|
type: accept,
|
|
124
125
|
success: (res) => resolve(formatFile(res)),
|
|
125
126
|
fail: reject
|
|
126
|
-
}
|
|
127
|
+
}
|
|
128
|
+
if (extension.length && extension.length > 0) {
|
|
129
|
+
params.extension = extension
|
|
130
|
+
}
|
|
131
|
+
uni.chooseFile(params)
|
|
127
132
|
// #endif
|
|
128
133
|
break
|
|
129
|
-
// #endif
|
|
130
|
-
default:
|
|
131
|
-
// 此为保底选项,在accept不为上面任意一项的时候选取全部文件
|
|
132
|
-
// #ifdef MP-WEIXIN
|
|
133
|
-
wx.chooseMessageFile({
|
|
134
|
-
count: multiple ? maxCount : 1,
|
|
135
|
-
type: 'all',
|
|
136
|
-
success: (res) => resolve(formatFile(res)),
|
|
137
|
-
fail: reject
|
|
138
|
-
})
|
|
139
|
-
// #endif
|
|
140
|
-
// #ifdef H5
|
|
141
|
-
// 需要hx2.9.9以上才支持uni.chooseFile
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
type: 'all',
|
|
145
|
-
success: (res) => resolve(formatFile(res)),
|
|
146
|
-
fail: reject
|
|
147
|
-
|
|
134
|
+
// #endif
|
|
135
|
+
default:
|
|
136
|
+
// 此为保底选项,在accept不为上面任意一项的时候选取全部文件
|
|
137
|
+
// #ifdef MP-WEIXIN
|
|
138
|
+
wx.chooseMessageFile({
|
|
139
|
+
count: multiple ? maxCount : 1,
|
|
140
|
+
type: 'all',
|
|
141
|
+
success: (res) => resolve(formatFile(res)),
|
|
142
|
+
fail: reject
|
|
143
|
+
})
|
|
144
|
+
// #endif
|
|
145
|
+
// #ifdef H5
|
|
146
|
+
// 需要hx2.9.9以上才支持uni.chooseFile
|
|
147
|
+
let paramsFile = {
|
|
148
|
+
count: multiple ? maxCount : 1,
|
|
149
|
+
type: 'all',
|
|
150
|
+
success: (res) => resolve(formatFile(res)),
|
|
151
|
+
fail: reject
|
|
152
|
+
}
|
|
153
|
+
if (extension.length && extension.length > 0) {
|
|
154
|
+
paramsFile.extension = extension
|
|
155
|
+
}
|
|
156
|
+
uni.chooseFile(paramsFile)
|
|
148
157
|
// #endif
|
|
149
158
|
}
|
|
150
159
|
})
|
package/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// const pleaseSetTranspileDependencies = {}, babelTest = pleaseSetTranspileDependencies?.test
|
|
3
3
|
|
|
4
4
|
// 引入全局mixin
|
|
5
|
-
import mixin from './libs/mixin/mixin.js'
|
|
5
|
+
import { mixin } from './libs/mixin/mixin.js'
|
|
6
6
|
// 小程序特有的mixin
|
|
7
|
-
import mpMixin from './libs/mixin/mpMixin.js'
|
|
7
|
+
import { mpMixin } from './libs/mixin/mpMixin.js'
|
|
8
8
|
// 全局挂载引入http相关请求拦截插件
|
|
9
9
|
import Request from './libs/luch-request'
|
|
10
10
|
|
package/libs/mixin/button.js
CHANGED
package/libs/mixin/mixin.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineMixin } from '../vue'
|
|
2
|
+
import { deepMerge, $parent } from '../function/index'
|
|
3
|
+
import test from '../function/test'
|
|
4
|
+
import route from '../util/route'
|
|
5
|
+
|
|
6
|
+
export const mixin = defineMixin({
|
|
5
7
|
// 定义每个组件都可能需要用到的外部样式以及类名
|
|
6
8
|
props: {
|
|
7
9
|
// 每个组件都有的父组件传递的样式,可以为字符串或者对象形式
|
|
@@ -169,4 +171,6 @@ export default {
|
|
|
169
171
|
})
|
|
170
172
|
}
|
|
171
173
|
}
|
|
172
|
-
}
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
export default mixin
|
package/libs/mixin/mpMixin.js
CHANGED
package/libs/mixin/mpShare.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { defineMixin } from '../vue'
|
|
1
2
|
|
|
2
|
-
export
|
|
3
|
+
export const mpShare = defineMixin({
|
|
3
4
|
data() {
|
|
4
5
|
return {
|
|
5
6
|
mpShare: {
|
|
@@ -12,4 +13,6 @@ export default {
|
|
|
12
13
|
onShareAppMessage() {
|
|
13
14
|
return this.mpShare;
|
|
14
15
|
}
|
|
15
|
-
}
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
export default mpShare
|
package/libs/mixin/openType.js
CHANGED
package/libs/mixin/style.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { defineMixin } from '../vue'
|
|
2
|
+
import { addStyle, deepMerge, addUnit, trim } from '../function/index'
|
|
3
|
+
|
|
4
|
+
export const style = defineMixin({
|
|
3
5
|
props: {
|
|
4
6
|
// flex排列方式
|
|
5
7
|
flexDirection: {
|
|
@@ -244,4 +246,4 @@ export default {
|
|
|
244
246
|
return trim(unit).split(' ').map((item) => addUnit(item)).join(' ')
|
|
245
247
|
}
|
|
246
248
|
}
|
|
247
|
-
}
|
|
249
|
+
})
|
package/libs/mixin/touch.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { defineMixin } from '../vue'
|
|
2
|
+
|
|
1
3
|
const MIN_DISTANCE = 10
|
|
2
4
|
|
|
3
5
|
function getDirection(x, y) {
|
|
@@ -10,7 +12,7 @@ function getDirection(x, y) {
|
|
|
10
12
|
return ''
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
export
|
|
15
|
+
export const touchMixin = defineMixin({
|
|
14
16
|
methods: {
|
|
15
17
|
getTouchPoint(e) {
|
|
16
18
|
if (!e) {
|
|
@@ -56,4 +58,4 @@ export default {
|
|
|
56
58
|
this.direction = this.direction || getDirection(this.offsetX, this.offsetY)
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
|
-
}
|
|
61
|
+
})
|
package/libs/vue.js
ADDED
package/package.json
CHANGED
package/types/comps/popup.d.ts
CHANGED