sh-view 2.7.6 → 2.7.8

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 CHANGED
@@ -71,16 +71,16 @@ createApp(App).use(ShView).mount('#app')
71
71
 
72
72
 
73
73
  #### 项目预览
74
- <img alt="img.png" src="examples/assets/img/img.png" width="100%"/>
75
- <img alt="img_1.png" src="examples/assets/img/img_1.png" width="49%"/>
76
- <img alt="img_2.png" src="examples/assets/img/img_2.png" width="49%"/>
77
- <img alt="img_3.png" src="examples/assets/img/img_3.png" width="49%"/>
78
- <img alt="img_4.png" src="examples/assets/img/img_4.png" width="49%"/>
79
- <img alt="img_5.png" src="examples/assets/img/img_5.png" width="49%"/>
80
- <img alt="img_6.png" src="examples/assets/img/img_6.png" width="49%"/>
81
- <img alt="img_7.png" src="examples/assets/img/img_7.png" width="49%"/>
82
- <img alt="img_8.png" src="examples/assets/img/img_8.png" width="49%"/>
83
- <img alt="img_9.png" src="examples/assets/img/img_9.png" width="49%"/>
84
- <img alt="img_10.png" src="examples/assets/img/img_10.png" width="49%"/>
85
- <img alt="img_11.png" src="examples/assets/img/img_11.png" width="49%"/>
86
- <img alt="img_12.png" src="examples/assets/img/img_12.png" width="49%"/>
74
+ <img alt="img.png" src="public/img/img.png" width="100%"/>
75
+ <img alt="img_1.png" src="public/img/img_1.png" width="49%"/>
76
+ <img alt="img_2.png" src="public/img/img_2.png" width="49%"/>
77
+ <img alt="img_3.png" src="public/img/img_3.png" width="49%"/>
78
+ <img alt="img_4.png" src="public/img/img_4.png" width="49%"/>
79
+ <img alt="img_5.png" src="public/img/img_5.png" width="49%"/>
80
+ <img alt="img_6.png" src="public/img/img_6.png" width="49%"/>
81
+ <img alt="img_7.png" src="public/img/img_7.png" width="49%"/>
82
+ <img alt="img_8.png" src="public/img/img_8.png" width="49%"/>
83
+ <img alt="img_9.png" src="public/img/img_9.png" width="49%"/>
84
+ <img alt="img_10.png" src="public/img/img_10.png" width="49%"/>
85
+ <img alt="img_11.png" src="public/img/img_11.png" width="49%"/>
86
+ <img alt="img_12.png" src="public/img/img_12.png" width="49%"/>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sh-view",
3
- "version": "2.7.6",
4
- "description": "基于vxe-table二次封装",
3
+ "version": "2.7.8",
4
+ "description": "基于vxe-table二次封装,更包含Alert,Badge,Card,CodeEditor,Col,Corner,CountTo,Drawer,Empty,Form,Header,Icon,List,Loading,Modal,Noticebar,Poptip,Progress,PullRefresh,Query,Result,Row,Split,Grid,Table,Tabs,Tag,Toolbar,Tree,Upload,WaterFall,WaterMark等丰富组件库",
5
5
  "main": "packages/index.js",
6
6
  "scripts": {
7
7
  "serve": "vue-cli-service serve",
@@ -21,7 +21,7 @@
21
21
  "babel-polyfill": "^6.26.0",
22
22
  "codemirror": "^6.0.1",
23
23
  "core-js": "^3.32.2",
24
- "countup.js": "^1.9.3",
24
+ "countup.js": "^2.8.0",
25
25
  "cron-parser": "^4.8.1",
26
26
  "docx-preview": "^0.1.18",
27
27
  "exceljs": "^4.3.0",
@@ -7,8 +7,8 @@
7
7
  </template>
8
8
 
9
9
  <script>
10
- import { defineComponent, ref, watch, onMounted, onUnmounted } from 'vue'
11
- import * as CountUpJs from 'countup.js'
10
+ import { defineComponent, ref, watch, onMounted, onUnmounted, computed } from 'vue'
11
+ import { CountUp } from 'countup.js'
12
12
  export default defineComponent({
13
13
  name: 'ShCountTo',
14
14
  props: {
@@ -19,10 +19,6 @@ export default defineComponent({
19
19
  end: {
20
20
  type: Number
21
21
  },
22
- decimals: {
23
- type: Number,
24
- default: 0
25
- },
26
22
  duration: {
27
23
  type: Number,
28
24
  default: 2
@@ -42,54 +38,74 @@ export default defineComponent({
42
38
  }
43
39
  },
44
40
  setup(props, context) {
45
- const countUp = ref(null)
41
+ let countUp = null
46
42
  const countRef = ref()
47
43
 
44
+ const countOptions = computed(() => {
45
+ return Object.assign(
46
+ {
47
+ startVal: props.start, // 开始的数字 一般设置0开始
48
+ decimalPlaces: 0, // number类型 小数位,整数自动添.00
49
+ duration: props.duration, // number类型 动画延迟秒数,默认值是2
50
+ useGrouping: true, // boolean类型 是否开启逗号,默认true(1,000)false(1000)
51
+ useEasing: true, // booleanl类型 动画缓动效果(ease),默认true
52
+ smartEasingThreshold: 500, // numberl类型 大于这个数值的值开启平滑缓动
53
+ smartEasingAmount: 300, // numberl类型
54
+ separator: ',', // string 类型 分割用的符号
55
+ decimal: '.', // string 类型 小数分割符合
56
+ prefix: '', // sttring 类型 数字开头添加固定字符
57
+ suffix: '', // sttring类型 数字末尾添加固定字符
58
+ numerals: [] // Array类型 替换从0到9对应的字,也就是自定数字字符了,数组存储
59
+ },
60
+ props.options
61
+ )
62
+ })
63
+
48
64
  watch(
49
65
  () => props.end,
50
66
  value => {
51
- if (countUp.value && countUp.value.update) {
52
- countUp.value.update(value)
67
+ if (countUp && countUp.update) {
68
+ countUp.update(value)
53
69
  }
54
70
  }
55
71
  )
56
72
 
57
73
  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)
74
+ if (!countUp) {
75
+ countUp = new CountUp(countRef.value, props.end, countOptions.value)
76
+ countUp.start(() => {
77
+ props.callback(countUp)
62
78
  })
63
79
  }
64
80
  }
65
81
 
66
82
  const destroy = () => {
67
- countUp.value = null
83
+ countUp = null
68
84
  }
69
85
 
70
- const start = callback => {
71
- if (countUp.value && countUp.value.start) {
72
- countUp.value.start(() => {
73
- callback && callback(countUp.value)
86
+ const countStart = callback => {
87
+ if (countUp && countUp.start) {
88
+ countUp.start(() => {
89
+ callback && callback(countUp)
74
90
  })
75
91
  }
76
92
  }
77
93
 
78
- const pauseResume = () => {
79
- if (countUp.value && countUp.value.pauseResume) {
80
- countUp.value.pauseResume()
94
+ const countPause = () => {
95
+ if (countUp && countUp.pauseResume) {
96
+ countUp.pauseResume()
81
97
  }
82
98
  }
83
99
 
84
- const reset = () => {
85
- if (countUp.value && countUp.value.reset) {
86
- countUp.value.reset()
100
+ const countReset = () => {
101
+ if (countUp && countUp.reset) {
102
+ countUp.reset()
87
103
  }
88
104
  }
89
105
 
90
- const updated = newEndVal => {
91
- if (countUp.value && countUp.value.update) {
92
- countUp.value.update(newEndVal)
106
+ const countUpdate = newEndVal => {
107
+ if (countUp && countUp.update) {
108
+ countUp.update(newEndVal)
93
109
  }
94
110
  }
95
111
 
@@ -102,7 +118,11 @@ export default defineComponent({
102
118
  })
103
119
 
104
120
  return {
105
- countRef
121
+ countRef,
122
+ countStart,
123
+ countPause,
124
+ countReset,
125
+ countUpdate
106
126
  }
107
127
  }
108
128
  })