sh-view 2.1.0 → 2.3.0

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 (128) hide show
  1. package/package.json +9 -13
  2. package/packages/components/global-components/sh-alert/index.vue +175 -173
  3. package/packages/components/global-components/sh-badge/index.vue +57 -43
  4. package/packages/components/global-components/sh-card/index.vue +24 -16
  5. package/packages/components/global-components/sh-code-editor/index.vue +250 -260
  6. package/packages/components/global-components/sh-col/index.vue +44 -36
  7. package/packages/components/global-components/sh-corner/index.vue +230 -228
  8. package/packages/components/global-components/sh-count-to/index.vue +60 -51
  9. package/packages/components/global-components/sh-drawer/index.vue +209 -182
  10. package/packages/components/global-components/sh-drawer/scrollbar.js +44 -42
  11. package/packages/components/global-components/sh-empty/index.vue +0 -1
  12. package/packages/components/global-components/sh-form/form.vue +110 -0
  13. package/packages/components/global-components/sh-form/js/props.js +76 -63
  14. package/packages/components/global-components/sh-form/js/useForm.js +236 -0
  15. package/packages/components/global-components/sh-form/query.vue +70 -0
  16. package/packages/components/global-components/sh-header/index.vue +35 -50
  17. package/packages/components/global-components/sh-icon/css/index.scss +44 -0
  18. package/packages/components/global-components/sh-icon/index.vue +24 -11
  19. package/packages/components/global-components/sh-image/index.vue +47 -38
  20. package/packages/components/global-components/sh-list/index.vue +42 -37
  21. package/packages/components/global-components/sh-loading/index.vue +12 -8
  22. package/packages/components/global-components/sh-modal/index.vue +49 -40
  23. package/packages/components/global-components/sh-noticebar/index.vue +68 -54
  24. package/packages/components/global-components/sh-poptip/index.vue +247 -130
  25. package/packages/components/global-components/sh-progress/index.vue +71 -69
  26. package/packages/components/global-components/sh-pull-refresh/index.vue +156 -157
  27. package/packages/components/global-components/sh-result/index.vue +37 -28
  28. package/packages/components/global-components/sh-row/index.vue +21 -18
  29. package/packages/components/global-components/sh-split/index.vue +115 -109
  30. package/packages/components/global-components/sh-table/components/importModal.vue +95 -86
  31. package/packages/components/global-components/sh-table/components/sh-column.vue +62 -0
  32. package/packages/components/global-components/sh-table/{index.vue → grid.vue} +34 -145
  33. package/packages/components/global-components/sh-table/js/tableMethods.js +175 -0
  34. package/packages/components/global-components/sh-table/js/useTable.js +592 -0
  35. package/packages/components/global-components/sh-table/table.vue +266 -0
  36. package/packages/components/global-components/sh-tabs/index.vue +118 -93
  37. package/packages/components/global-components/sh-tag/index.vue +52 -51
  38. package/packages/components/global-components/sh-toolbar/index.vue +53 -47
  39. package/packages/components/global-components/sh-tree/components/table-tree.vue +152 -139
  40. package/packages/components/global-components/sh-tree/index.vue +218 -195
  41. package/packages/components/global-components/sh-tree/mixin/treeProps.js +118 -120
  42. package/packages/components/global-components/sh-upload/index.vue +308 -51
  43. package/packages/components/global-components/sh-water-fall/index.vue +4 -11
  44. package/packages/components/index.js +5 -3
  45. package/packages/components/other-components/sh-cron-modal/components/cron-content.vue +140 -129
  46. package/packages/components/other-components/sh-cron-modal/css/index.scss +0 -5
  47. package/packages/components/other-components/sh-cron-modal/index.vue +81 -67
  48. package/packages/components/other-components/sh-cron-modal/mixin/cron-emits.js +1 -0
  49. package/packages/components/other-components/sh-cron-modal/mixin/cron-hooks.js +179 -0
  50. package/packages/components/other-components/sh-cron-modal/mixin/cron-props.js +9 -0
  51. package/packages/components/other-components/sh-cron-modal/tabs/cron-day-box.vue +101 -92
  52. package/packages/components/other-components/sh-cron-modal/tabs/cron-hour-box.vue +68 -56
  53. package/packages/components/other-components/sh-cron-modal/tabs/cron-minute-box.vue +68 -56
  54. package/packages/components/other-components/sh-cron-modal/tabs/cron-month-box.vue +68 -56
  55. package/packages/components/other-components/sh-cron-modal/tabs/cron-second-box.vue +68 -56
  56. package/packages/components/other-components/sh-cron-modal/tabs/cron-week-box.vue +126 -115
  57. package/packages/components/other-components/sh-cron-modal/tabs/cron-year-box.vue +59 -46
  58. package/packages/components/other-components/sh-menu/index.vue +73 -60
  59. package/packages/components/other-components/sh-menu/menu-group-content.vue +71 -59
  60. package/packages/components/other-components/sh-menu/menu-item-content.vue +40 -30
  61. package/packages/components/other-components/sh-menu-card/index.vue +70 -64
  62. package/packages/components/other-components/sh-menu-card/menu-box.vue +50 -44
  63. package/packages/components/other-components/sh-preview/components/sh-excel.vue +182 -0
  64. package/packages/components/other-components/sh-preview/components/sh-word.vue +73 -0
  65. package/packages/components/other-components/sh-preview/index.vue +86 -85
  66. package/packages/components/other-components/sh-preview/js/data-hook.js +37 -0
  67. package/packages/components/other-components/sh-preview/js/data-props.js +11 -0
  68. package/packages/components/other-components/sh-system-tip/index.vue +28 -24
  69. package/packages/css/index.js +4 -4
  70. package/packages/directive/module/prevent-click.js +1 -1
  71. package/packages/directive/module/resize.js +11 -154
  72. package/packages/index.js +39 -39
  73. package/packages/mixin/index.js +86 -87
  74. package/packages/vxeTable/render/cell/vxe-render-checkbox.vue +14 -5
  75. package/packages/vxeTable/render/cell/vxe-render-checkgroup.vue +43 -36
  76. package/packages/vxeTable/render/cell/vxe-render-code.vue +14 -5
  77. package/packages/vxeTable/render/cell/vxe-render-goption.vue +34 -24
  78. package/packages/vxeTable/render/cell/vxe-render-href.vue +21 -11
  79. package/packages/vxeTable/render/cell/vxe-render-img.vue +16 -10
  80. package/packages/vxeTable/render/cell/vxe-render-input.vue +83 -79
  81. package/packages/vxeTable/render/cell/vxe-render-money.vue +14 -6
  82. package/packages/vxeTable/render/cell/vxe-render-progress.vue +28 -19
  83. package/packages/vxeTable/render/cell/vxe-render-radio.vue +14 -5
  84. package/packages/vxeTable/render/cell/vxe-render-radiogroup.vue +43 -36
  85. package/packages/vxeTable/render/cell/vxe-render-select.vue +44 -36
  86. package/packages/vxeTable/render/cell/vxe-render-switch.vue +14 -5
  87. package/packages/vxeTable/render/cell/vxe-render-table.vue +51 -78
  88. package/packages/vxeTable/render/cell/vxe-render-textarea.vue +14 -5
  89. package/packages/vxeTable/render/cell/vxe-render-time.vue +23 -13
  90. package/packages/vxeTable/render/cell/vxe-render-tree.vue +23 -27
  91. package/packages/vxeTable/render/cell/vxe-render-upload.vue +11 -7
  92. package/packages/vxeTable/render/filters/vxe-filter-input.vue +25 -43
  93. package/packages/vxeTable/render/footer/vxe-footer-input.vue +23 -13
  94. package/packages/vxeTable/render/footer/vxe-footer-money.vue +30 -20
  95. package/packages/vxeTable/render/globalRenders.jsx +1 -1
  96. package/packages/vxeTable/render/header/vxe-header-money.vue +31 -21
  97. package/packages/vxeTable/render/mixin/cell-hooks.js +162 -0
  98. package/packages/vxeTable/render/mixin/cell-props.js +23 -0
  99. package/packages/vxeTable/render/mixin/filter-hooks.js +28 -0
  100. package/packages/components/global-components/sh-form/components/form-item.vue +0 -25
  101. package/packages/components/global-components/sh-form/css/index.scss +0 -55
  102. package/packages/components/global-components/sh-form/index.vue +0 -114
  103. package/packages/components/global-components/sh-form/js/methods.js +0 -146
  104. package/packages/components/global-components/sh-form/mixin/defaultData.js +0 -32
  105. package/packages/components/global-components/sh-icon/css/default/index.scss +0 -27
  106. package/packages/components/global-components/sh-icon/css/font/index.scss +0 -16
  107. package/packages/components/global-components/sh-icon/icon-default.vue +0 -32
  108. package/packages/components/global-components/sh-icon/icon-font.vue +0 -32
  109. package/packages/components/global-components/sh-poptip/popper.js +0 -115
  110. package/packages/components/global-components/sh-query/index.vue +0 -317
  111. package/packages/components/global-components/sh-table/js/methods.js +0 -549
  112. package/packages/components/global-components/sh-table/mixin/defaultData.js +0 -94
  113. package/packages/components/global-components/sh-upload/js/mixin.js +0 -257
  114. package/packages/components/other-components/sh-cron-modal/mixin/cron-box.js +0 -169
  115. package/packages/vxeTable/render/mixin/cell-mixin.js +0 -195
  116. /package/packages/components/global-components/sh-icon/css/default/{fonts/ionicons.svg → ionicons.svg} +0 -0
  117. /package/packages/components/global-components/sh-icon/css/default/{fonts/ionicons.ttf → ionicons.ttf} +0 -0
  118. /package/packages/components/global-components/sh-icon/css/default/{fonts/ionicons.woff → ionicons.woff} +0 -0
  119. /package/packages/components/global-components/sh-icon/css/default/{fonts/ionicons.woff2 → ionicons.woff2} +0 -0
  120. /package/packages/components/global-components/sh-icon/css/font/{fonts/iconfont.js → iconfont.js} +0 -0
  121. /package/packages/components/global-components/sh-icon/css/font/{fonts/iconfont.json → iconfont.json} +0 -0
  122. /package/packages/components/global-components/sh-icon/css/font/{fonts/iconfont.ttf → iconfont.ttf} +0 -0
  123. /package/packages/components/global-components/sh-icon/css/font/{fonts/iconfont.woff → iconfont.woff} +0 -0
  124. /package/packages/components/global-components/sh-icon/css/font/{fonts/iconfont.woff2 → iconfont.woff2} +0 -0
  125. /package/packages/{assets/css → css}/animated.scss +0 -0
  126. /package/packages/{assets/css → css}/loader.scss +0 -0
  127. /package/packages/{assets/css → css}/main.scss +0 -0
  128. /package/packages/{assets/css → css}/theme.scss +0 -0
@@ -1,228 +1,230 @@
1
- <template>
2
- <a class="sh-corner" :style="styles" :class="classes">
3
- <div class="sh-corner-content">
4
- <div v-if="title || $slots.title">{{ title }}</div>
5
- <span v-if="$slots.default"><slot></slot></span>
6
- </div>
7
- <span class="sh-corner-bg" :style="cornerStyles"></span>
8
- </a>
9
- </template>
10
-
11
- <script>
12
- export default {
13
- name: 'ShCorner',
14
- components: {},
15
- props: {
16
- color: {
17
- type: String,
18
- default: '#e8e8e8'
19
- },
20
- title: {
21
- type: [String, Number],
22
- default: ''
23
- },
24
- width: {
25
- type: [String, Number],
26
- default: '60'
27
- },
28
- height: {
29
- type: [String, Number],
30
- default: '60'
31
- },
32
- font: {
33
- type: [String, Number],
34
- default: '10'
35
- },
36
- placement: {
37
- type: String,
38
- default: 'top-right'
39
- },
40
- rotate: [Boolean],
41
- dark: [Boolean]
42
- },
43
- data() {
44
- return {}
45
- },
46
- computed: {
47
- styles() {
48
- return {
49
- borderColor: this.color,
50
- width: `${this.width}px`,
51
- height: `${this.height}px`,
52
- fontSize: `${this.font}px`,
53
- color: this.dark ? '#fff' : ''
54
- }
55
- },
56
- cornerStyles() {
57
- return {
58
- borderWidth: `${this.width}px`
59
- }
60
- },
61
- placeClass() {
62
- return this.placement.toLowerCase().split('-')
63
- },
64
- classes() {
65
- return [
66
- ...this.placeClass,
67
- {
68
- 'sh-rotate': this.rotate
69
- }
70
- ]
71
- }
72
- },
73
- watch: {},
74
- created() {},
75
- methods: {}
76
- }
77
- </script>
78
-
79
- <style lang="scss">
80
- $corner-size: 4em;
81
- .sh-corner {
82
- display: inline-block;
83
- position: absolute;
84
- top: 0;
85
- right: 0;
86
- margin: 0;
87
- padding: 0 !important;
88
- text-align: center;
89
- border-color: #e8e8e8;
90
- line-height: 1;
91
- vertical-align: baseline;
92
- overflow: hidden;
93
- width: $corner-size;
94
- height: $corner-size;
95
- z-index: 1;
96
- color: inherit;
97
- background-color: transparent;
98
- &:hover {
99
- color: inherit;
100
- }
101
- > .sh-corner-content {
102
- position: absolute;
103
- margin: 0;
104
- padding: 15% 5px;
105
- width: 100%;
106
- height: 100%;
107
- right: 0;
108
- top: 0;
109
- display: inline-flex;
110
- justify-content: flex-end;
111
- align-items: flex-start;
112
- flex-wrap: wrap;
113
- }
114
- &.sh-rotate {
115
- > .sh-corner-content {
116
- transform-origin: center;
117
- justify-content: center !important;
118
- }
119
- &.top.left {
120
- > .sh-corner-content {
121
- right: auto;
122
- left: 0;
123
- top: 0;
124
- transform: rotateZ(-45deg);
125
- }
126
- }
127
- &.top.right {
128
- > .sh-corner-content {
129
- right: 0;
130
- left: auto;
131
- top: 0;
132
- transform: rotateZ(45deg);
133
- }
134
- }
135
- &.bottom.left {
136
- > .sh-corner-content {
137
- right: auto;
138
- left: 0;
139
- bottom: 0;
140
- top: auto;
141
- transform: rotateZ(45deg);
142
- align-items: flex-end;
143
- }
144
- }
145
- &.bottom.right {
146
- > .sh-corner-content {
147
- right: 0;
148
- left: auto;
149
- bottom: 0;
150
- top: auto;
151
- transform: rotateZ(-45deg);
152
- align-items: flex-end;
153
- }
154
- }
155
- }
156
- & .sh-corner-bg {
157
- position: absolute;
158
- content: '';
159
- right: 0;
160
- top: 0;
161
- z-index: -1;
162
- width: 0;
163
- height: 0;
164
- background-color: transparent;
165
- border-style: solid;
166
- border-color: inherit;
167
- }
168
- &.top.left {
169
- right: auto;
170
- left: 0;
171
- top: 0;
172
- & .sh-corner-bg {
173
- right: auto;
174
- left: 0;
175
- top: 0;
176
- border-bottom-color: transparent !important;
177
- border-right-color: transparent !important;
178
- border-top-width: 0 !important;
179
- }
180
- > .sh-corner-content {
181
- justify-content: flex-start;
182
- }
183
- }
184
- &.top.right {
185
- right: 0;
186
- left: auto;
187
- top: 0;
188
- & .sh-corner-bg {
189
- border-bottom-color: transparent !important;
190
- border-left-color: transparent !important;
191
- border-top-width: 0 !important;
192
- }
193
- }
194
- &.bottom.left {
195
- right: auto;
196
- left: 0;
197
- bottom: 0;
198
- top: auto;
199
- & .sh-corner-bg {
200
- right: auto;
201
- left: 0;
202
- bottom: 0;
203
- top: auto;
204
- border-top-color: transparent !important;
205
- border-right-color: transparent !important;
206
- border-bottom-width: 0 !important;
207
- }
208
- > .sh-corner-content {
209
- justify-content: flex-start;
210
- }
211
- }
212
- &.bottom.right {
213
- right: 0;
214
- left: auto;
215
- bottom: 0;
216
- top: auto;
217
- & .sh-corner-bg {
218
- right: 0;
219
- left: auto;
220
- bottom: 0;
221
- top: auto;
222
- border-top-color: transparent !important;
223
- border-left-color: transparent !important;
224
- border-bottom-width: 0 !important;
225
- }
226
- }
227
- }
228
- </style>
1
+ <template>
2
+ <a class="sh-corner" :style="styles" :class="classes">
3
+ <div class="sh-corner-content">
4
+ <div v-if="title || slots.title">{{ title }}</div>
5
+ <span v-if="slots.default"><slot></slot></span>
6
+ </div>
7
+ <span class="sh-corner-bg" :style="cornerStyles"></span>
8
+ </a>
9
+ </template>
10
+
11
+ <script>
12
+ import { defineComponent, computed } from 'vue'
13
+ export default defineComponent({
14
+ name: 'ShCorner',
15
+ props: {
16
+ color: {
17
+ type: String,
18
+ default: '#e8e8e8'
19
+ },
20
+ title: {
21
+ type: [String, Number],
22
+ default: ''
23
+ },
24
+ width: {
25
+ type: [String, Number],
26
+ default: '60'
27
+ },
28
+ height: {
29
+ type: [String, Number],
30
+ default: '60'
31
+ },
32
+ font: {
33
+ type: [String, Number],
34
+ default: '10'
35
+ },
36
+ placement: {
37
+ type: String,
38
+ default: 'top-right'
39
+ },
40
+ rotate: [Boolean],
41
+ dark: [Boolean]
42
+ },
43
+ setup(props, context) {
44
+ const { slots } = context
45
+ const styles = computed(() => {
46
+ return {
47
+ borderColor: props.color,
48
+ width: `${props.width}px`,
49
+ height: `${props.height}px`,
50
+ fontSize: `${props.font}px`,
51
+ color: props.dark ? '#fff' : ''
52
+ }
53
+ })
54
+ const cornerStyles = computed(() => {
55
+ return {
56
+ borderWidth: `${props.width}px`
57
+ }
58
+ })
59
+ const placeClass = computed(() => {
60
+ return props.placement.toLowerCase().split('-')
61
+ })
62
+ const classes = computed(() => {
63
+ return [
64
+ ...placeClass.value,
65
+ {
66
+ 'sh-rotate': props.rotate
67
+ }
68
+ ]
69
+ })
70
+
71
+ return {
72
+ styles,
73
+ classes,
74
+ cornerStyles,
75
+ slots
76
+ }
77
+ }
78
+ })
79
+ </script>
80
+
81
+ <style lang="scss">
82
+ $corner-size: 4em;
83
+ .sh-corner {
84
+ display: inline-block;
85
+ position: absolute;
86
+ top: 0;
87
+ right: 0;
88
+ margin: 0;
89
+ padding: 0 !important;
90
+ text-align: center;
91
+ border-color: #e8e8e8;
92
+ line-height: 1;
93
+ vertical-align: baseline;
94
+ overflow: hidden;
95
+ width: $corner-size;
96
+ height: $corner-size;
97
+ z-index: 1;
98
+ color: inherit;
99
+ background-color: transparent;
100
+ &:hover {
101
+ color: inherit;
102
+ }
103
+ > .sh-corner-content {
104
+ position: absolute;
105
+ margin: 0;
106
+ padding: 15% 5px;
107
+ width: 100%;
108
+ height: 100%;
109
+ right: 0;
110
+ top: 0;
111
+ display: inline-flex;
112
+ justify-content: flex-end;
113
+ align-items: flex-start;
114
+ flex-wrap: wrap;
115
+ }
116
+ &.sh-rotate {
117
+ > .sh-corner-content {
118
+ transform-origin: center;
119
+ justify-content: center !important;
120
+ }
121
+ &.top.left {
122
+ > .sh-corner-content {
123
+ right: auto;
124
+ left: 0;
125
+ top: 0;
126
+ transform: rotateZ(-45deg);
127
+ }
128
+ }
129
+ &.top.right {
130
+ > .sh-corner-content {
131
+ right: 0;
132
+ left: auto;
133
+ top: 0;
134
+ transform: rotateZ(45deg);
135
+ }
136
+ }
137
+ &.bottom.left {
138
+ > .sh-corner-content {
139
+ right: auto;
140
+ left: 0;
141
+ bottom: 0;
142
+ top: auto;
143
+ transform: rotateZ(45deg);
144
+ align-items: flex-end;
145
+ }
146
+ }
147
+ &.bottom.right {
148
+ > .sh-corner-content {
149
+ right: 0;
150
+ left: auto;
151
+ bottom: 0;
152
+ top: auto;
153
+ transform: rotateZ(-45deg);
154
+ align-items: flex-end;
155
+ }
156
+ }
157
+ }
158
+ & .sh-corner-bg {
159
+ position: absolute;
160
+ content: '';
161
+ right: 0;
162
+ top: 0;
163
+ z-index: -1;
164
+ width: 0;
165
+ height: 0;
166
+ background-color: transparent;
167
+ border-style: solid;
168
+ border-color: inherit;
169
+ }
170
+ &.top.left {
171
+ right: auto;
172
+ left: 0;
173
+ top: 0;
174
+ & .sh-corner-bg {
175
+ right: auto;
176
+ left: 0;
177
+ top: 0;
178
+ border-bottom-color: transparent !important;
179
+ border-right-color: transparent !important;
180
+ border-top-width: 0 !important;
181
+ }
182
+ > .sh-corner-content {
183
+ justify-content: flex-start;
184
+ }
185
+ }
186
+ &.top.right {
187
+ right: 0;
188
+ left: auto;
189
+ top: 0;
190
+ & .sh-corner-bg {
191
+ border-bottom-color: transparent !important;
192
+ border-left-color: transparent !important;
193
+ border-top-width: 0 !important;
194
+ }
195
+ }
196
+ &.bottom.left {
197
+ right: auto;
198
+ left: 0;
199
+ bottom: 0;
200
+ top: auto;
201
+ & .sh-corner-bg {
202
+ right: auto;
203
+ left: 0;
204
+ bottom: 0;
205
+ top: auto;
206
+ border-top-color: transparent !important;
207
+ border-right-color: transparent !important;
208
+ border-bottom-width: 0 !important;
209
+ }
210
+ > .sh-corner-content {
211
+ justify-content: flex-start;
212
+ }
213
+ }
214
+ &.bottom.right {
215
+ right: 0;
216
+ left: auto;
217
+ bottom: 0;
218
+ top: auto;
219
+ & .sh-corner-bg {
220
+ right: 0;
221
+ left: auto;
222
+ bottom: 0;
223
+ top: auto;
224
+ border-top-color: transparent !important;
225
+ border-left-color: transparent !important;
226
+ border-bottom-width: 0 !important;
227
+ }
228
+ }
229
+ }
230
+ </style>
@@ -1,14 +1,15 @@
1
1
  <template>
2
2
  <div class="sh-count-to">
3
3
  <slot name="left"></slot>
4
- <span ref="count" class="count-up" :class="countClass"></span>
4
+ <span ref="countRef" class="count-up" :class="countClass"></span>
5
5
  <slot name="right"></slot>
6
6
  </div>
7
7
  </template>
8
8
 
9
9
  <script>
10
- import CountUp from 'countup.js'
11
- export default {
10
+ import { defineComponent, ref, watch, onMounted, onUnmounted } from 'vue'
11
+ import CountUpJs from 'countup.js'
12
+ export default defineComponent({
12
13
  name: 'ShCountTo',
13
14
  props: {
14
15
  start: {
@@ -40,63 +41,71 @@ export default {
40
41
  type: [String, Object]
41
42
  }
42
43
  },
43
- data() {
44
- return {
45
- CountUp: null
46
- }
47
- },
48
- watch: {
49
- end(value) {
50
- if (this.CountUp && this.CountUp.update) {
51
- this.CountUp.update(value)
44
+ setup(props, context) {
45
+ const countUp = ref(null)
46
+ const countRef = ref()
47
+
48
+ watch(
49
+ () => props.end,
50
+ value => {
51
+ if (countUp.value && countUp.value.update) {
52
+ countUp.value.update(value)
53
+ }
54
+ }
55
+ )
56
+
57
+ const init = () => {
58
+ if (!countUp.value) {
59
+ countUp.value = new CountUpJs(countRef.value, props.start, props.end, props.decimals, props.duration, props.options)
60
+ countUp.value.start(() => {
61
+ props.callback(countUp.value)
62
+ })
52
63
  }
53
64
  }
54
- },
55
- mounted() {
56
- this.init()
57
- },
58
- methods: {
59
- init() {
60
- if (!this.CountUp) {
61
- this.CountUp = new CountUp(this.$refs.count, this.start, this.end, this.decimals, this.duration, this.options)
62
- this.CountUp.start(() => {
63
- this.callback(this.CountUp)
65
+
66
+ const destroy = () => {
67
+ countUp.value = null
68
+ }
69
+
70
+ const start = callback => {
71
+ if (countUp.value && countUp.value.start) {
72
+ countUp.value.start(() => {
73
+ callback && callback(countUp.value)
64
74
  })
65
75
  }
66
- },
67
- destroy() {
68
- this.CountUp = null
69
76
  }
70
- },
71
- beforeUnmounted() {
72
- this.destroy()
73
- },
74
- start(callback) {
75
- if (this.CountUp && this.CountUp.start) {
76
- this.CountUp.start(() => {
77
- callback && callback(this.CountUp)
78
- })
77
+
78
+ const pauseResume = () => {
79
+ if (countUp.value && countUp.value.pauseResume) {
80
+ countUp.value.pauseResume()
81
+ }
79
82
  }
80
- },
81
- pauseResume() {
82
- if (this.CountUp && this.CountUp.pauseResume) {
83
- this.CountUp.pauseResume()
83
+
84
+ const reset = () => {
85
+ if (countUp.value && countUp.value.reset) {
86
+ countUp.value.reset()
87
+ }
84
88
  }
85
- },
86
- reset() {
87
- if (this.CountUp && this.CountUp.reset) {
88
- this.CountUp.reset()
89
+
90
+ const updated = newEndVal => {
91
+ if (countUp.value && countUp.value.update) {
92
+ countUp.value.update(newEndVal)
93
+ }
89
94
  }
90
- },
91
- update(newEndVal) {
92
- if (this.CountUp && this.CountUp.update) {
93
- this.CountUp.update(newEndVal)
95
+
96
+ onMounted(() => {
97
+ init()
98
+ })
99
+
100
+ onUnmounted(() => {
101
+ destroy()
102
+ })
103
+
104
+ return {
105
+ countRef
94
106
  }
95
107
  }
96
- }
108
+ })
97
109
  </script>
98
110
 
99
- <style scoped lang="scss">
100
- .sh-count-to {
101
- }
102
- </style>
111
+ <style scoped lang="scss"></style>