我可以用我的组件调整dhtmlxGantt显示屏吗



我使用dhtmlxGantt是因为我的项目中需要甘特图,但我有解扩问题。我使用vuejs组件,这就是为什么我把dhtmlxGantt的代码放在我的组件中,但显示不清楚这是我的代码://甘特图组件

<template>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">

<div class="card-body">
<div id="gantt_here">
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
created(){
gantt.init("gantt_here");
},
mounted() {
console.log('Component mounted.')
}
}
</script>
<style scoped>
body{
margin: 10px ;
}
</style>

我称之为两个文件

<script src="https://cdn.dhtmlx.com/gantt/edge/dhtmlxgantt.js"></script>
<link href="https://cdn.dhtmlx.com/gantt/edge/dhtmlxgantt.css" rel="stylesheet">

请帮我

VueJS在组件外部的javascript组件方面非常复杂,在这种情况下,我可以建议您对组件库进行内部导入并尝试使用它,因为我从未使用过这个组件,所以我不知道它是否使用jQuery,但在VueJS中有使用jQuery的方法。如何使用它的示例是使用命令npm install --save @types/dhtmlxgantt安装库,并将其导入到组件中。

<script>
import gantt from '@types/dhtmlxgantt'
export default {
...
created() {
gantt.init("gantt_here");
}
}
</script>

最新更新