pull/1196/head^2
Tuğçe Küçükoğlu 2021-05-05 17:34:48 +03:00
commit 551b0f6b28
1 changed files with 9 additions and 7 deletions

View File

@ -5,8 +5,6 @@
</template> </template>
<script> <script>
import * as Chart from 'chart.js';
export default { export default {
emits: ['select'], emits: ['select'],
props: { props: {
@ -45,11 +43,15 @@ export default {
}, },
methods: { methods: {
initChart() { initChart() {
this.chart = new Chart(this.$refs.canvas, { import('chart.js').then((module) => {
if (module && module.default) {
this.chart = new module.default(this.$refs.canvas, {
type: this.type, type: this.type,
data: this.data, data: this.data,
options: this.options options: this.options
}); });
}
});
}, },
getCanvas() { getCanvas() {
return this.$canvas; return this.$canvas;