File tree 1 file changed +10
-2
lines changed
src/dispatch/static/dispatch/src/dashboard
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<v-card variant =" outlined" :loading =" loading" >
3
3
<v-card-title >{{ title }}</v-card-title >
4
- <apexchart :type =" type" height =" 250" :options =" localOptions" :series =" series" />
4
+ <apexchart :type =" type" height =" 250" :options =" localOptions" :series =" sanitize( series) " />
5
5
</v-card >
6
6
</template >
7
7
8
8
<script >
9
9
import VueApexCharts from " vue3-apexcharts"
10
+ import DOMPurify from " dompurify"
11
+
10
12
export default {
11
13
name: " DashboardCard" ,
12
14
@@ -40,7 +42,13 @@ export default {
40
42
required: true ,
41
43
},
42
44
},
43
-
45
+ methods: {
46
+ sanitize (series ) {
47
+ return series .map ((s ) => {
48
+ return { name: DOMPurify .sanitize (s .name ), data: s .data }
49
+ })
50
+ },
51
+ },
44
52
data () {
45
53
return {
46
54
localOptions: JSON .parse (JSON .stringify (this .options )),
You can’t perform that action at this time.
0 commit comments