Components added. Build issues fixed

This commit is contained in:
Bahadir Sofuoglu 2022-09-14 14:26:01 +03:00
parent 5b66ed1093
commit 18c3721848
344 changed files with 12446 additions and 8758 deletions

View file

@ -20,18 +20,9 @@ export default {
height: {
type: Number,
default: 150
},
},
chart: null,
mounted() {
this.initChart();
},
beforeUnmount() {
if (this.chart) {
this.chart.destroy();
this.chart = null;
}
},
chart: null,
watch: {
/*
* Use deep watch to enable triggering watch for changes within structure
@ -50,6 +41,15 @@ export default {
this.reinit();
}
},
mounted() {
this.initChart();
},
beforeUnmount() {
if (this.chart) {
this.chart.destroy();
this.chart = null;
}
},
methods: {
initChart() {
import('chart.js/auto').then((module) => {
@ -93,7 +93,7 @@ export default {
const dataset = this.chart.getElementsAtEventForMode(event, 'dataset', { intersect: true }, false);
if (element && element[0] && dataset) {
this.$emit('select', {originalEvent: event, element: element[0], dataset: dataset});
this.$emit('select', { originalEvent: event, element: element[0], dataset: dataset });
}
}
},
@ -103,7 +103,7 @@ export default {
}
}
}
}
};
</script>
<style>