dpzvc3-ui 3.1.4 → 3.1.6
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/README.md +1 -1
- package/dist/dpzvc3.esm.js +5 -4
- package/dist/dpzvc3.esm.js.map +1 -1
- package/dist/dpzvc3.esm.min.js +1 -1
- package/dist/dpzvc3.esm.min.js.map +1 -1
- package/dist/dpzvc3.js +5 -4
- package/dist/dpzvc3.js.map +1 -1
- package/dist/dpzvc3.min.js +1 -1
- package/dist/dpzvc3.min.js.map +1 -1
- package/dist/types/components/actionSheet/index.d.ts +6 -1
- package/dist/types/components/actionSheet/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/package.json +7 -2
- package/build-style.js +0 -58
- package/dist-prod/91.05c8ec5277a15f939b0f.js +0 -3
- package/dist-prod/91.05c8ec5277a15f939b0f.js.LICENSE.txt +0 -25
- package/dist-prod/91.05c8ec5277a15f939b0f.js.map +0 -1
- package/dist-prod/actionsheet.0d67b6b08a62cf9360be.chunk.js +0 -2
- package/dist-prod/actionsheet.0d67b6b08a62cf9360be.chunk.js.map +0 -1
- package/dist-prod/badge.16ab5c05734fe1530701.chunk.js +0 -2
- package/dist-prod/badge.16ab5c05734fe1530701.chunk.js.map +0 -1
- package/dist-prod/button.39ac33aa7aaccc24b6a1.chunk.js +0 -2
- package/dist-prod/button.39ac33aa7aaccc24b6a1.chunk.js.map +0 -1
- package/dist-prod/card.16ed7eafe471bcc60ec6.chunk.js +0 -2
- package/dist-prod/card.16ed7eafe471bcc60ec6.chunk.js.map +0 -1
- package/dist-prod/cell.70ff74fba57e27df7f5a.chunk.js +0 -2
- package/dist-prod/cell.70ff74fba57e27df7f5a.chunk.js.map +0 -1
- package/dist-prod/cellswipe.f3ec62abd60729d8bc5a.chunk.js +0 -2
- package/dist-prod/cellswipe.f3ec62abd60729d8bc5a.chunk.js.map +0 -1
- package/dist-prod/checkbox.05c63a947ac98293c9f2.chunk.js +0 -2
- package/dist-prod/checkbox.05c63a947ac98293c9f2.chunk.js.map +0 -1
- package/dist-prod/guide.24f1968a568f20fbc84b.chunk.js +0 -2
- package/dist-prod/guide.24f1968a568f20fbc84b.chunk.js.map +0 -1
- package/dist-prod/header.eb10433dd892738ee95a.chunk.js +0 -2
- package/dist-prod/header.eb10433dd892738ee95a.chunk.js.map +0 -1
- package/dist-prod/index.html +0 -19
- package/dist-prod/indicator.0c09e3f238791cb478e0.chunk.js +0 -2
- package/dist-prod/indicator.0c09e3f238791cb478e0.chunk.js.map +0 -1
- package/dist-prod/loadmore.9bad88767cc43603f473.chunk.js +0 -2
- package/dist-prod/loadmore.9bad88767cc43603f473.chunk.js.map +0 -1
- package/dist-prod/main.662ad15361e7f3d20234.js +0 -2
- package/dist-prod/main.662ad15361e7f3d20234.js.map +0 -1
- package/dist-prod/message.de17fea3de4daa70bab4.chunk.js +0 -2
- package/dist-prod/message.de17fea3de4daa70bab4.chunk.js.map +0 -1
- package/dist-prod/modal.f9ec857acd9fbdf53f3b.chunk.js +0 -2
- package/dist-prod/modal.f9ec857acd9fbdf53f3b.chunk.js.map +0 -1
- package/dist-prod/picker.bca059ef59e3c42a401f.chunk.js +0 -2
- package/dist-prod/picker.bca059ef59e3c42a401f.chunk.js.map +0 -1
- package/dist-prod/popup.538422c7e188363a468d.chunk.js +0 -2
- package/dist-prod/popup.538422c7e188363a468d.chunk.js.map +0 -1
- package/dist-prod/progress.240de4b633002f573030.chunk.js +0 -2
- package/dist-prod/progress.240de4b633002f573030.chunk.js.map +0 -1
- package/dist-prod/prompt.dcda0b05ea02d59106b7.chunk.js +0 -2
- package/dist-prod/prompt.dcda0b05ea02d59106b7.chunk.js.map +0 -1
- package/dist-prod/radiobox.7c10f77aba5ae04b2e5c.chunk.js +0 -2
- package/dist-prod/radiobox.7c10f77aba5ae04b2e5c.chunk.js.map +0 -1
- package/dist-prod/rater.d46ae462c598c458e5a8.chunk.js +0 -2
- package/dist-prod/rater.d46ae462c598c458e5a8.chunk.js.map +0 -1
- package/dist-prod/slidebar.833e75b9eb0abef92453.chunk.js +0 -2
- package/dist-prod/slidebar.833e75b9eb0abef92453.chunk.js.map +0 -1
- package/dist-prod/spinner.6afb4f84cc29f0e2f8eb.chunk.js +0 -2
- package/dist-prod/spinner.6afb4f84cc29f0e2f8eb.chunk.js.map +0 -1
- package/dist-prod/swipe.3fe6ee6638765ec52d94.chunk.js +0 -2
- package/dist-prod/swipe.3fe6ee6638765ec52d94.chunk.js.map +0 -1
- package/dist-prod/switchbar.f24c76a03120f1bd961a.chunk.js +0 -2
- package/dist-prod/switchbar.f24c76a03120f1bd961a.chunk.js.map +0 -1
- package/dist-prod/tab.29f19483f699b7811259.chunk.js +0 -2
- package/dist-prod/tab.29f19483f699b7811259.chunk.js.map +0 -1
- package/dist-prod/text.a6e4251f772d23843e2b.chunk.js +0 -2
- package/dist-prod/text.a6e4251f772d23843e2b.chunk.js.map +0 -1
- package/dist-prod/totop.713c5ab7f7dbcffbf2a3.chunk.js +0 -2
- package/dist-prod/totop.713c5ab7f7dbcffbf2a3.chunk.js.map +0 -1
- package/dist-prod/upload.0638581e551ed9afaba2.chunk.js +0 -2
- package/dist-prod/upload.0638581e551ed9afaba2.chunk.js.map +0 -1
- package/postcss.config.js +0 -5
- package/src/components/Indicator/Indicator.tsx +0 -67
- package/src/components/Indicator/Indicator.vue +0 -82
- package/src/components/Indicator/index.ts +0 -111
- package/src/components/Indicator/types.ts +0 -15
- package/src/components/Text/index.ts +0 -14
- package/src/components/Text/textBar.tsx +0 -104
- package/src/components/Text/types.ts +0 -13
- package/src/components/actionSheet/actionSheet.d.ts +0 -16
- package/src/components/actionSheet/actionSheet.tsx +0 -86
- package/src/components/actionSheet/index.ts +0 -6
- package/src/components/actionSheet/types.ts +0 -10
- package/src/components/app.vue +0 -59
- package/src/components/badge/badge.tsx +0 -80
- package/src/components/badge/index.ts +0 -12
- package/src/components/badge/types.ts +0 -8
- package/src/components/button/button.tsx +0 -105
- package/src/components/button/index.ts +0 -13
- package/src/components/button/types.ts +0 -13
- package/src/components/card/card.d.ts +0 -16
- package/src/components/card/card.tsx +0 -38
- package/src/components/card/index.ts +0 -12
- package/src/components/card/types.ts +0 -3
- package/src/components/cell/cell.tsx +0 -89
- package/src/components/cell/index.ts +0 -12
- package/src/components/cell/types.ts +0 -8
- package/src/components/cellSwipe/cellSwipe.tsx +0 -188
- package/src/components/cellSwipe/index.ts +0 -13
- package/src/components/cellSwipe/types.ts +0 -17
- package/src/components/checkBox/checkbox-group.tsx +0 -75
- package/src/components/checkBox/checkbox.tsx +0 -107
- package/src/components/checkBox/index.ts +0 -29
- package/src/components/checkBox/types.ts +0 -32
- package/src/components/header/header.tsx +0 -119
- package/src/components/header/index.ts +0 -13
- package/src/components/header/types.ts +0 -7
- package/src/components/loadMore/index.ts +0 -14
- package/src/components/loadMore/loadMore.tsx +0 -265
- package/src/components/loadMore/types.ts +0 -26
- package/src/components/message/confirm.ts +0 -104
- package/src/components/message/index.ts +0 -113
- package/src/components/message/message.tsx +0 -100
- package/src/components/message/messageGroup.tsx +0 -59
- package/src/components/message/types.ts +0 -48
- package/src/components/modal/confirm.ts +0 -123
- package/src/components/modal/index.ts +0 -68
- package/src/components/modal/modal.tsx +0 -248
- package/src/components/modal/types.ts +0 -51
- package/src/components/number/Number.tsx +0 -143
- package/src/components/number/index.ts +0 -10
- package/src/components/number/types.ts +0 -13
- package/src/components/picker/area-picker/area-picker.vue +0 -230
- package/src/components/picker/area-picker/props.js +0 -17
- package/src/components/picker/date-picker/date-picker.vue +0 -191
- package/src/components/picker/date-picker/props.js +0 -24
- package/src/components/picker/index.ts +0 -12
- package/src/components/picker/normal-picker/normal-picker.vue +0 -120
- package/src/components/picker/normal-picker/props.js +0 -20
- package/src/components/picker/picker-slot.vue +0 -217
- package/src/components/picker/picker.tsx +0 -112
- package/src/components/picker/types.ts +0 -17
- package/src/components/popup/index.ts +0 -12
- package/src/components/popup/popup.d.ts +0 -16
- package/src/components/popup/popup.tsx +0 -68
- package/src/components/popup/types.ts +0 -9
- package/src/components/progress/index.ts +0 -12
- package/src/components/progress/progress.tsx +0 -81
- package/src/components/progress/types.ts +0 -9
- package/src/components/prompt/confirm.ts +0 -104
- package/src/components/prompt/index.ts +0 -50
- package/src/components/prompt/prompt.tsx +0 -161
- package/src/components/prompt/types.ts +0 -45
- package/src/components/radioBox/index.ts +0 -34
- package/src/components/radioBox/radiobox-group.tsx +0 -66
- package/src/components/radioBox/radiobox-group1.vue +0 -66
- package/src/components/radioBox/radiobox.tsx +0 -115
- package/src/components/radioBox/radiobox1.vue +0 -89
- package/src/components/radioBox/types.ts +0 -24
- package/src/components/rater/index.ts +0 -12
- package/src/components/rater/rater.d.ts +0 -16
- package/src/components/rater/raters.tsx +0 -101
- package/src/components/rater/types.ts +0 -10
- package/src/components/slideBar/index.ts +0 -13
- package/src/components/slideBar/slideBar.tsx +0 -288
- package/src/components/slideBar/types.ts +0 -20
- package/src/components/spinner/behavior/blade.vue +0 -42
- package/src/components/spinner/behavior/double-bounce.vue +0 -38
- package/src/components/spinner/behavior/fading-circle.vue +0 -55
- package/src/components/spinner/behavior/snake.vue +0 -41
- package/src/components/spinner/behavior/triple-bounce.vue +0 -52
- package/src/components/spinner/index.ts +0 -13
- package/src/components/spinner/props.js +0 -28
- package/src/components/spinner/spinner.tsx +0 -85
- package/src/components/spinner/types.ts +0 -20
- package/src/components/swipe/index.ts +0 -13
- package/src/components/swipe/swipe.tsx +0 -292
- package/src/components/swipe/types.ts +0 -21
- package/src/components/switchbar/index.ts +0 -13
- package/src/components/switchbar/switchbar.tsx +0 -58
- package/src/components/switchbar/types.ts +0 -6
- package/src/components/tab/index.ts +0 -12
- package/src/components/tab/tab.tsx +0 -71
- package/src/components/tab/types.ts +0 -15
- package/src/components/toTop/index.ts +0 -13
- package/src/components/toTop/toTop.tsx +0 -54
- package/src/components/toTop/types.ts +0 -7
- package/src/components/upload/index.ts +0 -13
- package/src/components/upload/types.ts +0 -9
- package/src/components/upload/upload.tsx +0 -180
- package/src/config/config.js +0 -16
- package/src/directives/clickoutside.js +0 -42
- package/src/directives/tranferDom.js +0 -66
- package/src/index.d.ts +0 -131
- package/src/index.ts +0 -136
- package/src/lib/MegaPixImage.js +0 -164
- package/src/lib/MegaPixImageOld.js +0 -153
- package/src/lib/exif-js.js +0 -235
- package/src/lib/exif.js +0 -789
- package/src/lib/lib.js +0 -22
- package/src/main.ts +0 -33
- package/src/mixin/emitter.js +0 -72
- package/src/mixin/input.js +0 -41
- package/src/router.ts +0 -36
- package/src/shims-vue.d.ts +0 -37
- package/src/styles/base/font.less +0 -99
- package/src/styles/base/reset.less +0 -135
- package/src/styles/base/variable.less +0 -108
- package/src/styles/components/actionSheet.less +0 -43
- package/src/styles/components/badge.less +0 -81
- package/src/styles/components/button.less +0 -124
- package/src/styles/components/card.less +0 -31
- package/src/styles/components/cell-swipe.less +0 -20
- package/src/styles/components/cell.less +0 -75
- package/src/styles/components/checkBox.less +0 -113
- package/src/styles/components/editor.less +0 -3
- package/src/styles/components/header.less +0 -72
- package/src/styles/components/indicator.less +0 -39
- package/src/styles/components/loadmore.less +0 -48
- package/src/styles/components/message.less +0 -57
- package/src/styles/components/modal.less +0 -84
- package/src/styles/components/number.less +0 -60
- package/src/styles/components/picker.less +0 -152
- package/src/styles/components/popup.less +0 -46
- package/src/styles/components/progress.less +0 -52
- package/src/styles/components/prompt.less +0 -37
- package/src/styles/components/radioBox.less +0 -142
- package/src/styles/components/rater.less +0 -16
- package/src/styles/components/slide-Bar.less +0 -149
- package/src/styles/components/spinner.less +0 -329
- package/src/styles/components/swipe.less +0 -125
- package/src/styles/components/switchBar.less +0 -88
- package/src/styles/components/tab.less +0 -71
- package/src/styles/components/text.less +0 -82
- package/src/styles/components/toTop.less +0 -28
- package/src/styles/components/upload.less +0 -23
- package/src/styles/index.less +0 -39
- package/src/styles/utils/1px.less +0 -206
- package/src/styles/utils/animation.less +0 -165
- package/src/styles/utils/nowrap.less +0 -19
- package/src/template/index.ejs +0 -40
- package/src/types/index.d.ts +0 -127
- package/src/types/js-shims.d.ts +0 -36
- package/src/utils/test.ts +0 -2
- package/src/utils/util.ts +0 -168
- package/src/utils/util1.js +0 -202
- package/src/vconsole-resources.min.js +0 -6
- package/src/vconsole-sources.min.js +0 -6
- package/src/vconsole.min.js +0 -7
- package/src/views/ActionSheet.vue +0 -46
- package/src/views/Badge/Badge.less +0 -12
- package/src/views/Badge/Badge.tsx +0 -23
- package/src/views/Badge.vue +0 -53
- package/src/views/Button.vue +0 -69
- package/src/views/Card.vue +0 -89
- package/src/views/Cell.vue +0 -31
- package/src/views/CellSwipe.vue +0 -80
- package/src/views/CheckBox.vue +0 -78
- package/src/views/Header.vue +0 -71
- package/src/views/Indicator.vue +0 -82
- package/src/views/LoadMore.vue +0 -76
- package/src/views/Message.vue +0 -61
- package/src/views/Modal.vue +0 -69
- package/src/views/Picker.vue +0 -142
- package/src/views/Popup.vue +0 -103
- package/src/views/Progress.vue +0 -49
- package/src/views/Prompt.vue +0 -43
- package/src/views/RadioBox.vue +0 -70
- package/src/views/Rater.vue +0 -53
- package/src/views/SlideBar.vue +0 -62
- package/src/views/Spinner.vue +0 -27
- package/src/views/Swipe.vue +0 -59
- package/src/views/SwitchBar.vue +0 -49
- package/src/views/Tab.vue +0 -55
- package/src/views/Text.vue +0 -97
- package/src/views/ToTop.vue +0 -31
- package/src/views/Upload.vue +0 -65
- package/src/views/guide.vue +0 -164
- package/src/views/index.vue +0 -554
- package/tsconfig.build.json +0 -31
- package/tsconfig.json +0 -41
- package/webpack.base.config.js +0 -85
- package/webpack.dev.config.js +0 -43
- package/webpack.dist.dev.config.js +0 -76
- package/webpack.dist.prod.config.js +0 -90
- package/webpack.prod.config.js +0 -52
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
// src/components/slideBar/slideBar.tsx
|
|
2
|
-
import {
|
|
3
|
-
defineComponent,
|
|
4
|
-
ref,
|
|
5
|
-
computed,
|
|
6
|
-
onMounted,
|
|
7
|
-
onBeforeUnmount,
|
|
8
|
-
PropType
|
|
9
|
-
} from 'vue'
|
|
10
|
-
import type { SlideBarProps, SlideBarItem } from './types'
|
|
11
|
-
|
|
12
|
-
export type { SlideBarProps }
|
|
13
|
-
|
|
14
|
-
const prefixCls = 'dpzvc3-slideBar'
|
|
15
|
-
|
|
16
|
-
export default defineComponent({
|
|
17
|
-
name: 'SlideBar',
|
|
18
|
-
|
|
19
|
-
props: {
|
|
20
|
-
scrollHeight: {
|
|
21
|
-
type: [String, Number] as PropType<string | number>,
|
|
22
|
-
default: '30px'
|
|
23
|
-
},
|
|
24
|
-
height: {
|
|
25
|
-
type: [String, Number] as PropType<string | number>,
|
|
26
|
-
default: '100%'
|
|
27
|
-
},
|
|
28
|
-
styles: {
|
|
29
|
-
type: Object as PropType<Record<string, any>>,
|
|
30
|
-
default: () => ({})
|
|
31
|
-
},
|
|
32
|
-
childWidth: {
|
|
33
|
-
type: Number,
|
|
34
|
-
default: 70
|
|
35
|
-
},
|
|
36
|
-
scrollColor: {
|
|
37
|
-
type: String,
|
|
38
|
-
default: '#036eb8'
|
|
39
|
-
},
|
|
40
|
-
textAlign: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: 'center'
|
|
43
|
-
},
|
|
44
|
-
flex: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default: true
|
|
47
|
-
},
|
|
48
|
-
type: {
|
|
49
|
-
type: String as PropType<SlideBarProps['type']>,
|
|
50
|
-
default: 'normal'
|
|
51
|
-
},
|
|
52
|
-
list: {
|
|
53
|
-
type: Array as PropType<SlideBarItem[]>,
|
|
54
|
-
default: () => [{ name: '1' }, { name: '2' }, { name: '3' }, { name: '4' }]
|
|
55
|
-
},
|
|
56
|
-
index: {
|
|
57
|
-
type: Number,
|
|
58
|
-
default: 0
|
|
59
|
-
},
|
|
60
|
-
distanceIndex: {
|
|
61
|
-
type: Number,
|
|
62
|
-
default: 1.5
|
|
63
|
-
},
|
|
64
|
-
canDrag: {
|
|
65
|
-
type: Boolean,
|
|
66
|
-
default: true
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
emits: ['on-change'],
|
|
71
|
-
|
|
72
|
-
setup(props: SlideBarProps, { emit, slots }) {
|
|
73
|
-
const headerRef = ref<HTMLDivElement | null>(null)
|
|
74
|
-
const contentRef = ref<HTMLDivElement | null>(null)
|
|
75
|
-
|
|
76
|
-
const startIndex = ref(props.index ?? 0)
|
|
77
|
-
const clientWidth = ref(0)
|
|
78
|
-
const dragging = ref(false)
|
|
79
|
-
const distance = ref(0)
|
|
80
|
-
const startTranslateX = ref(0)
|
|
81
|
-
const startX = ref(0)
|
|
82
|
-
|
|
83
|
-
const items = ref(props.list ?? [])
|
|
84
|
-
const isFlex = ref(!!props.flex)
|
|
85
|
-
const fixed = ref(false)
|
|
86
|
-
|
|
87
|
-
const translateX = ref(0)
|
|
88
|
-
|
|
89
|
-
const getItemWidth = computed(() =>
|
|
90
|
-
isFlex.value
|
|
91
|
-
? clientWidth.value / items.value.length
|
|
92
|
-
: props.childWidth!
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
const classes = computed(() => [prefixCls])
|
|
96
|
-
|
|
97
|
-
const headerClasses = computed(() => [
|
|
98
|
-
`${prefixCls}-header`,
|
|
99
|
-
{ fixed: fixed.value }
|
|
100
|
-
])
|
|
101
|
-
|
|
102
|
-
const wrapperClasses = computed(() => [
|
|
103
|
-
`${prefixCls}-wrapper`,
|
|
104
|
-
isFlex.value ? `${prefixCls}-flex` : `${prefixCls}-slide`,
|
|
105
|
-
{
|
|
106
|
-
normal: props.type === 'normal' && isFlex.value,
|
|
107
|
-
vertical: props.type === 'vertical' && isFlex.value
|
|
108
|
-
}
|
|
109
|
-
])
|
|
110
|
-
|
|
111
|
-
const contentClasses = computed(() => [
|
|
112
|
-
`${prefixCls}-content`,
|
|
113
|
-
{ [`${prefixCls}-dragging`]: dragging.value }
|
|
114
|
-
])
|
|
115
|
-
|
|
116
|
-
const absoluteClass = computed(() => [`${prefixCls}-wrapper-absolute`])
|
|
117
|
-
const containerClass = computed(() => [`${prefixCls}-container`])
|
|
118
|
-
|
|
119
|
-
const getStyles = computed(() => ({ ...props.styles }))
|
|
120
|
-
|
|
121
|
-
const getContainerStyle = computed(() => ({
|
|
122
|
-
width: clientWidth.value * items.value.length + 'px',
|
|
123
|
-
transform: `translate3d(${translateX.value}px,0,0)`
|
|
124
|
-
}))
|
|
125
|
-
|
|
126
|
-
const getScrollStyle = computed(() => ({
|
|
127
|
-
width: getItemWidth.value + 'px',
|
|
128
|
-
transform: `translate3d(${startIndex.value * getItemWidth.value}px,0,0)`,
|
|
129
|
-
backgroundColor: props.scrollColor
|
|
130
|
-
}))
|
|
131
|
-
|
|
132
|
-
const maxIndex = computed(() => items.value.length - 1)
|
|
133
|
-
|
|
134
|
-
/* tab 切换 */
|
|
135
|
-
const changeBar = (index: number) => {
|
|
136
|
-
if (startIndex.value === index) return
|
|
137
|
-
startIndex.value = index
|
|
138
|
-
translateX.value = -index * clientWidth.value
|
|
139
|
-
emit('on-change', index)
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/* 拖拽逻辑 */
|
|
143
|
-
const onTouchStart = (e: TouchEvent) => {
|
|
144
|
-
startTranslateX.value = translateX.value
|
|
145
|
-
distance.value = 0
|
|
146
|
-
startX.value = e.touches[0].clientX
|
|
147
|
-
dragging.value = true
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const onTouchMove = (e: TouchEvent) => {
|
|
151
|
-
const currentX = e.touches[0].clientX
|
|
152
|
-
distance.value = props.distanceIndex
|
|
153
|
-
? (currentX - startX.value) / props.distanceIndex
|
|
154
|
-
: currentX - startX.value
|
|
155
|
-
translateX.value = startTranslateX.value + distance.value
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const onTouchEnd = () => {
|
|
159
|
-
if (distance.value < 0 && Math.abs(distance.value) > clientWidth.value / 2) {
|
|
160
|
-
slideLeft()
|
|
161
|
-
} else if (distance.value > 0 && Math.abs(distance.value) > clientWidth.value / 2) {
|
|
162
|
-
slideRight()
|
|
163
|
-
} else {
|
|
164
|
-
translateX.value = startTranslateX.value
|
|
165
|
-
}
|
|
166
|
-
dragging.value = false
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const slideLeft = () => {
|
|
170
|
-
if (startIndex.value >= maxIndex.value) {
|
|
171
|
-
translateX.value = startTranslateX.value
|
|
172
|
-
} else {
|
|
173
|
-
startIndex.value++
|
|
174
|
-
translateX.value = startTranslateX.value - clientWidth.value
|
|
175
|
-
}
|
|
176
|
-
emit('on-change', startIndex.value)
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
const slideRight = () => {
|
|
180
|
-
if (startIndex.value <= 0) {
|
|
181
|
-
translateX.value = startTranslateX.value
|
|
182
|
-
} else {
|
|
183
|
-
startIndex.value--
|
|
184
|
-
translateX.value = startTranslateX.value + clientWidth.value
|
|
185
|
-
}
|
|
186
|
-
emit('on-change', startIndex.value)
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/* 固定 header */
|
|
190
|
-
const onScroll = () => {
|
|
191
|
-
if (!headerRef.value) return
|
|
192
|
-
fixed.value = headerRef.value.getBoundingClientRect().top <= 0
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
const onResize = () => {
|
|
196
|
-
if (!headerRef.value) return
|
|
197
|
-
clientWidth.value = headerRef.value.clientWidth
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
onMounted(() => {
|
|
201
|
-
if (!headerRef.value) return
|
|
202
|
-
clientWidth.value = headerRef.value.clientWidth
|
|
203
|
-
translateX.value = -startIndex.value * clientWidth.value
|
|
204
|
-
|
|
205
|
-
window.addEventListener('resize', onResize)
|
|
206
|
-
window.addEventListener('scroll', onScroll)
|
|
207
|
-
|
|
208
|
-
if (props.canDrag && contentRef.value) {
|
|
209
|
-
contentRef.value.addEventListener('touchstart', onTouchStart)
|
|
210
|
-
contentRef.value.addEventListener('touchmove', onTouchMove)
|
|
211
|
-
contentRef.value.addEventListener('touchend', onTouchEnd)
|
|
212
|
-
}
|
|
213
|
-
})
|
|
214
|
-
|
|
215
|
-
onBeforeUnmount(() => {
|
|
216
|
-
window.removeEventListener('resize', onResize)
|
|
217
|
-
window.removeEventListener('scroll', onScroll)
|
|
218
|
-
|
|
219
|
-
if (props.canDrag && contentRef.value) {
|
|
220
|
-
contentRef.value.removeEventListener('touchstart', onTouchStart)
|
|
221
|
-
contentRef.value.removeEventListener('touchmove', onTouchMove)
|
|
222
|
-
contentRef.value.removeEventListener('touchend', onTouchEnd)
|
|
223
|
-
}
|
|
224
|
-
})
|
|
225
|
-
|
|
226
|
-
return () => (
|
|
227
|
-
<div class={classes.value} style={getStyles.value}>
|
|
228
|
-
{/* header */}
|
|
229
|
-
<div ref={headerRef} class={headerClasses.value}>
|
|
230
|
-
<div
|
|
231
|
-
class={wrapperClasses.value}
|
|
232
|
-
style={{
|
|
233
|
-
width: isFlex.value
|
|
234
|
-
? 'auto'
|
|
235
|
-
: items.value.length * getItemWidth.value + 'px'
|
|
236
|
-
}}
|
|
237
|
-
>
|
|
238
|
-
{items.value.map((item, key) => (
|
|
239
|
-
<div
|
|
240
|
-
key={key}
|
|
241
|
-
class={[
|
|
242
|
-
'dpzvc3-slideBar-child',
|
|
243
|
-
startIndex.value === key && 'active',
|
|
244
|
-
!isFlex.value && 'normalChild'
|
|
245
|
-
]}
|
|
246
|
-
style={{
|
|
247
|
-
textAlign: props.textAlign,
|
|
248
|
-
width: getItemWidth.value + 'px',
|
|
249
|
-
height: props.scrollHeight,
|
|
250
|
-
lineHeight: String(props.scrollHeight)
|
|
251
|
-
}}
|
|
252
|
-
onClick={() => changeBar(key)}
|
|
253
|
-
>
|
|
254
|
-
{slots[`slide-bar-header-${key}`]
|
|
255
|
-
? slots[`slide-bar-header-${key}`]!()
|
|
256
|
-
: <a class="content ellipse-fir">{item.name}</a>}
|
|
257
|
-
</div>
|
|
258
|
-
))}
|
|
259
|
-
</div>
|
|
260
|
-
|
|
261
|
-
<div class={absoluteClass.value} style={getScrollStyle.value} />
|
|
262
|
-
</div>
|
|
263
|
-
|
|
264
|
-
{/* content */}
|
|
265
|
-
<div class={containerClass.value} style={{ height: props.height }}>
|
|
266
|
-
<div
|
|
267
|
-
ref={contentRef}
|
|
268
|
-
class={contentClasses.value}
|
|
269
|
-
style={getContainerStyle.value}
|
|
270
|
-
>
|
|
271
|
-
{items.value.map((_, index) => (
|
|
272
|
-
<div
|
|
273
|
-
key={index}
|
|
274
|
-
class={[
|
|
275
|
-
'dpzvc3-slideBar-content-item',
|
|
276
|
-
startIndex.value === index && 'active'
|
|
277
|
-
]}
|
|
278
|
-
style={{ width: clientWidth.value + 'px' }}
|
|
279
|
-
>
|
|
280
|
-
{slots[`slot-item-${index}`]?.()}
|
|
281
|
-
</div>
|
|
282
|
-
))}
|
|
283
|
-
</div>
|
|
284
|
-
</div>
|
|
285
|
-
</div>
|
|
286
|
-
)
|
|
287
|
-
}
|
|
288
|
-
})
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// src/components/slideBar/types.ts
|
|
2
|
-
export interface SlideBarItem {
|
|
3
|
-
name: string
|
|
4
|
-
[key: string]: any
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface SlideBarProps {
|
|
8
|
-
scrollHeight?: string | number
|
|
9
|
-
height?: string | number
|
|
10
|
-
styles?: Record<string, any>
|
|
11
|
-
childWidth?: number
|
|
12
|
-
scrollColor?: string
|
|
13
|
-
textAlign?: string
|
|
14
|
-
flex?: boolean
|
|
15
|
-
type?: 'normal' | 'vertical'
|
|
16
|
-
list?: SlideBarItem[]
|
|
17
|
-
index?: number
|
|
18
|
-
distanceIndex?: number
|
|
19
|
-
canDrag?: boolean
|
|
20
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="dpzvc3-spinner-blade"
|
|
4
|
-
:style="spinnerStyle"
|
|
5
|
-
>
|
|
6
|
-
<div
|
|
7
|
-
v-for="i in 12"
|
|
8
|
-
:key="i"
|
|
9
|
-
class="blade"
|
|
10
|
-
:class="'blade-' + i"
|
|
11
|
-
:style="bladeStyle"
|
|
12
|
-
/>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
import { defineComponent, computed } from 'vue'
|
|
18
|
-
import spinnerProps from '../props' // 复用 spinnerProps
|
|
19
|
-
// 如果原来 mixins props 是这样
|
|
20
|
-
// {
|
|
21
|
-
// color: String,
|
|
22
|
-
// size: [Number, String]
|
|
23
|
-
// }
|
|
24
|
-
|
|
25
|
-
export default defineComponent({
|
|
26
|
-
name: 'Dpzvc3Blade',
|
|
27
|
-
props: spinnerProps.props,
|
|
28
|
-
setup (props) {
|
|
29
|
-
// 计算每个 blade 的样式
|
|
30
|
-
const bladeStyle = computed(() => {
|
|
31
|
-
return props.color ? { backgroundColor: props.color } : {}
|
|
32
|
-
})
|
|
33
|
-
const { spinnerStyle } = spinnerProps.setup(props)
|
|
34
|
-
// console.log(spinnerStyle, 'ddds')
|
|
35
|
-
// 如果需要设置整个 spinner 容器的大小
|
|
36
|
-
return {
|
|
37
|
-
bladeStyle,
|
|
38
|
-
spinnerStyle
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
</script>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="dpzvc3-spinner-double-bounce"
|
|
4
|
-
:style="spinnerStyle"
|
|
5
|
-
>
|
|
6
|
-
<div
|
|
7
|
-
v-for="i in 2"
|
|
8
|
-
:key="i"
|
|
9
|
-
class="bounce"
|
|
10
|
-
:class="'bounce-' + i"
|
|
11
|
-
:style="bounceStyle"
|
|
12
|
-
/>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
import { computed, defineComponent } from 'vue'
|
|
18
|
-
import spinnerProps from '../props' // 复用 spinnerProps
|
|
19
|
-
|
|
20
|
-
export default defineComponent({
|
|
21
|
-
name: 'Dpzvc3DoubleBounce',
|
|
22
|
-
props: spinnerProps.props,
|
|
23
|
-
setup (props) {
|
|
24
|
-
const { spinnerStyle } = spinnerProps.setup(props)
|
|
25
|
-
|
|
26
|
-
const bounceStyle = computed(() => {
|
|
27
|
-
return props.color
|
|
28
|
-
? { backgroundColor: props.color }
|
|
29
|
-
: {}
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
spinnerStyle,
|
|
34
|
-
bounceStyle
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
</script>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="dpzvc3-spinner-fading-circle"
|
|
4
|
-
:style="spinnerStyle"
|
|
5
|
-
>
|
|
6
|
-
<div
|
|
7
|
-
v-for="i in 12"
|
|
8
|
-
:key="i"
|
|
9
|
-
class="block"
|
|
10
|
-
:class="'block-' + i"
|
|
11
|
-
:style="blockStyle(i - 1)"
|
|
12
|
-
>
|
|
13
|
-
<div
|
|
14
|
-
class="circle"
|
|
15
|
-
:class="'circle-' + i"
|
|
16
|
-
:style="circleStyle(i - 1)"
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<script>
|
|
23
|
-
import { computed, defineComponent } from 'vue'
|
|
24
|
-
import spinnerProps from '../props'
|
|
25
|
-
|
|
26
|
-
export default defineComponent({
|
|
27
|
-
name: 'Dpzvc3FadingCircle',
|
|
28
|
-
props: spinnerProps.props,
|
|
29
|
-
setup (props) {
|
|
30
|
-
// 使用复用的 spinnerStyle
|
|
31
|
-
const { spinnerStyle } = spinnerProps.setup(props)
|
|
32
|
-
|
|
33
|
-
// block 旋转样式
|
|
34
|
-
const blockStyle = (index) => {
|
|
35
|
-
return {
|
|
36
|
-
transform: `rotate(${30 * index}deg)`
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// circle 样式,包括颜色和动画延迟
|
|
41
|
-
const circleStyle = (index) => {
|
|
42
|
-
return {
|
|
43
|
-
backgroundColor: props.color || '#39f',
|
|
44
|
-
animationDelay: `${(1.2 / 12) * index - 1.2}s`
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return {
|
|
49
|
-
spinnerStyle,
|
|
50
|
-
blockStyle,
|
|
51
|
-
circleStyle
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
|
-
</script>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="dpzvc3-spinner-snake"
|
|
4
|
-
:style="spinnerStyle"
|
|
5
|
-
/>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script>
|
|
9
|
-
import { computed, defineComponent } from 'vue'
|
|
10
|
-
import spinnerProps from '../props'
|
|
11
|
-
|
|
12
|
-
export default defineComponent({
|
|
13
|
-
name: 'Dpzvc3Snake',
|
|
14
|
-
props: spinnerProps.props,
|
|
15
|
-
setup (props) {
|
|
16
|
-
// 计算 spinner 样式
|
|
17
|
-
const spinnerStyle = computed(() => {
|
|
18
|
-
const style = {}
|
|
19
|
-
|
|
20
|
-
if (props.size) {
|
|
21
|
-
const borderSize = Math.ceil(props.size / 8)
|
|
22
|
-
style.height = props.size + 'px'
|
|
23
|
-
style.width = props.size + 'px'
|
|
24
|
-
style.borderWidth = borderSize + 'px'
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (props.color) {
|
|
28
|
-
style.borderTopColor = props.color
|
|
29
|
-
style.borderLeftColor = props.color
|
|
30
|
-
style.borderBottomColor = props.color
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return style
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
spinnerStyle
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
})
|
|
41
|
-
</script>
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="dpzvc3-spinner-triple-bounce"
|
|
4
|
-
:style="spinnerStyle"
|
|
5
|
-
>
|
|
6
|
-
<div
|
|
7
|
-
v-for="(i,key) in 3"
|
|
8
|
-
:key="key"
|
|
9
|
-
class="bounce"
|
|
10
|
-
:class="'bounce-' + i"
|
|
11
|
-
:style="bounceStyle"
|
|
12
|
-
/>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script type="text/ecmascript-6">
|
|
17
|
-
import props from '../props'
|
|
18
|
-
|
|
19
|
-
export default {
|
|
20
|
-
mixins: [props],
|
|
21
|
-
computed: {
|
|
22
|
-
// eslint-disable-next-line vue/return-in-computed-property
|
|
23
|
-
unitSize () {
|
|
24
|
-
if (this.size) {
|
|
25
|
-
return Math.round(this.size / 6) * 2
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
// eslint-disable-next-line vue/return-in-computed-property
|
|
29
|
-
spinnerStyle () {
|
|
30
|
-
if (this.size) {
|
|
31
|
-
return {
|
|
32
|
-
padding: (this.size - this.unitSize) / 2 + 'px 0'
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
bounceStyle () {
|
|
37
|
-
const style = {}
|
|
38
|
-
|
|
39
|
-
if (this.size) {
|
|
40
|
-
style.width = this.unitSize + 'px'
|
|
41
|
-
style.height = this.unitSize + 'px'
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (this.color) {
|
|
45
|
-
style.backgroundColor = this.color
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return style
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
</script>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by admin on 2025/10/16.
|
|
3
|
-
*/
|
|
4
|
-
import type { App } from 'vue'
|
|
5
|
-
import Spinner from './spinner'
|
|
6
|
-
Spinner.install = (app: App): void => {
|
|
7
|
-
app.component('Spinner', Spinner); // 注册全局组件
|
|
8
|
-
}
|
|
9
|
-
type IWithInstall<T> = T & { install(app: App): void };
|
|
10
|
-
const _Spinner=Spinner as IWithInstall<typeof Spinner>;
|
|
11
|
-
export default _Spinner
|
|
12
|
-
// export default Spinner
|
|
13
|
-
export type { SpinnerProps } from './types'
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// spinnerProps.js
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
props: {
|
|
6
|
-
size: {
|
|
7
|
-
type: [Number, String]
|
|
8
|
-
},
|
|
9
|
-
color: {
|
|
10
|
-
type: String
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
setup (props) {
|
|
14
|
-
const spinnerStyle = computed(() => {
|
|
15
|
-
if (props.size) {
|
|
16
|
-
return {
|
|
17
|
-
height: typeof Number(props.size) === 'number' ? `${props.size}px` : props.size,
|
|
18
|
-
width: typeof Number(props.size) === 'number' ? `${props.size}px` : props.size
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return {}
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
spinnerStyle
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
// src/components/spinner/spinner.tsx
|
|
2
|
-
import { defineComponent, computed, PropType } from 'vue'
|
|
3
|
-
// import type { DefineComponent } from 'vue'
|
|
4
|
-
import SpinnerBlade from './behavior/blade.vue'
|
|
5
|
-
import SpinnerSnake from './behavior/snake.vue'
|
|
6
|
-
import SpinnerDoubleBounce from './behavior/double-bounce.vue'
|
|
7
|
-
import SpinnerTripleBounce from './behavior/triple-bounce.vue'
|
|
8
|
-
import SpinnerFadingCircle from './behavior/fading-circle.vue'
|
|
9
|
-
|
|
10
|
-
import type { SpinnerProps, SpinnerType } from './types'
|
|
11
|
-
export type { SpinnerProps }
|
|
12
|
-
|
|
13
|
-
const SPINNERS = [
|
|
14
|
-
'blade',
|
|
15
|
-
'snake',
|
|
16
|
-
'double-bounce',
|
|
17
|
-
'triple-bounce',
|
|
18
|
-
'fading-circle'
|
|
19
|
-
] as const
|
|
20
|
-
|
|
21
|
-
const SPINNER_MAP = {
|
|
22
|
-
blade: SpinnerBlade,
|
|
23
|
-
snake: SpinnerSnake,
|
|
24
|
-
'double-bounce': SpinnerDoubleBounce,
|
|
25
|
-
'triple-bounce': SpinnerTripleBounce,
|
|
26
|
-
'fading-circle': SpinnerFadingCircle
|
|
27
|
-
} as const
|
|
28
|
-
|
|
29
|
-
function parseSpinner(type: SpinnerType | number): keyof typeof SPINNER_MAP {
|
|
30
|
-
let value: string | number = type ?? 0
|
|
31
|
-
|
|
32
|
-
// 数字类型(索引)
|
|
33
|
-
if (typeof value === 'number' || /^\d+$/.test(String(value))) {
|
|
34
|
-
const index = Number(value)
|
|
35
|
-
if (index >= SPINNERS.length) {
|
|
36
|
-
console.warn(`'${value}' spinner not found, use the default spinner.`)
|
|
37
|
-
return SPINNERS[0]
|
|
38
|
-
}
|
|
39
|
-
return SPINNERS[index]
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// 字符串类型
|
|
43
|
-
if (!SPINNERS.includes(value as any)) {
|
|
44
|
-
console.warn(`'${value}' spinner not found, use the default spinner.`)
|
|
45
|
-
return SPINNERS[0]
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return value as keyof typeof SPINNER_MAP
|
|
49
|
-
}
|
|
50
|
-
// type Compute<T> = { [K in keyof T]: Compute<T[K]> }; // 将类型展开方便提示
|
|
51
|
-
export default defineComponent({
|
|
52
|
-
name: 'Dpzvc3Spinner',
|
|
53
|
-
|
|
54
|
-
props: {
|
|
55
|
-
size: {
|
|
56
|
-
type: [Number, String] as PropType<number | string>,
|
|
57
|
-
default: 30
|
|
58
|
-
},
|
|
59
|
-
type: {
|
|
60
|
-
type: [String, Number] as PropType<SpinnerType | number>,
|
|
61
|
-
default: 'snake'
|
|
62
|
-
},
|
|
63
|
-
color: {
|
|
64
|
-
type: String as PropType<string>,
|
|
65
|
-
default: '#39f'
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
setup(props) {
|
|
70
|
-
const SpinnerComponent = computed(() => {
|
|
71
|
-
const key = parseSpinner(props.type)
|
|
72
|
-
return SPINNER_MAP[key]
|
|
73
|
-
})
|
|
74
|
-
return () => {
|
|
75
|
-
const Comp = SpinnerComponent.value as any
|
|
76
|
-
return (
|
|
77
|
-
<Comp
|
|
78
|
-
size={props.size}
|
|
79
|
-
type={props.type}
|
|
80
|
-
color={props.color}
|
|
81
|
-
/>
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
})
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// src/components/spinner/types.ts
|
|
2
|
-
export type SpinnerType =
|
|
3
|
-
| 'blade'
|
|
4
|
-
| 'snake'
|
|
5
|
-
| 'double-bounce'
|
|
6
|
-
| 'triple-bounce'
|
|
7
|
-
| 'fading-circle'
|
|
8
|
-
|
|
9
|
-
// type Compute<T> = { [K in keyof T]: T[K] extends Object ? Compute<T[K]> : T[K] }; // 将类型展开方便提示
|
|
10
|
-
// interface Spinner {
|
|
11
|
-
// size?: number | string
|
|
12
|
-
// type?: SpinnerType | number
|
|
13
|
-
// color?: string
|
|
14
|
-
// }
|
|
15
|
-
// export type SpinnerProps = Compute<Spinner>
|
|
16
|
-
export interface SpinnerProps {
|
|
17
|
-
size?: number | string
|
|
18
|
-
type?: SpinnerType | number
|
|
19
|
-
color?: string
|
|
20
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by admin on 2017/5/11.
|
|
3
|
-
*/
|
|
4
|
-
import type { App } from 'vue'
|
|
5
|
-
import Swipe from './swipe'
|
|
6
|
-
// export default Swipe
|
|
7
|
-
Swipe.install = (app: App): void => {
|
|
8
|
-
app.component('Swipe', Swipe); // 注册全局组件
|
|
9
|
-
}
|
|
10
|
-
type IWithInstall<T> = T & { install(app: App): void };
|
|
11
|
-
const _Swipe=Swipe as IWithInstall<typeof Swipe>;
|
|
12
|
-
export default _Swipe
|
|
13
|
-
export type { SwipeProps } from './types'
|