Skip to content

Commit 8c753a3

Browse files
committed
refactor: extract random() to shared/utils
1 parent 67f94d9 commit 8c753a3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/shared/utils.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function random (min, max) {
2+
return Math.floor(Math.random() * (max - min + 1) + min)
3+
}

src/views/dashboard/MainChartExample.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
import { Line } from 'vue-chartjs'
33
import { getStyle, hexToRgba } from '@coreui/coreui/dist/js/coreui-utilities'
44
import { CustomTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
5-
6-
function random (min, max) {
7-
return Math.floor(Math.random() * (max - min + 1) + min)
8-
}
5+
import { random } from '@/shared/utils'
96
107
export default {
118
extends: Line,

0 commit comments

Comments
 (0)