vue dhtmlxgantt gantt.config.columnResize = true 如何使用
时间: 2023-11-02 14:15:18 浏览: 97
在 Vue 中使用 dhtmlxgantt,可以通过以下步骤实现 `gantt.config.columnResize = true`:
1. 在 Vue 项目中安装 dhtmlxgantt:
```
npm install dhtmlxgantt --save
```
2. 在 Vue 组件中引入 dhtmlxgantt:
```
import "dhtmlxgantt";
```
3. 在 Vue 组件的 `mounted` 钩子函数中初始化 gantt:
```
mounted() {
gantt.init(this.$refs.ganttContainer);
}
```
4. 在初始化 gantt 后,设置 `columnResize` 属性为 `true`:
```
mounted() {
gantt.init(this.$refs.ganttContainer);
gantt.config.columnResize = true;
}
```
这样就可以启用 gantt 列的调整大小功能了。注意,如果希望在列调整大小时触发回调函数,可以设置 `onColumnResize` 属性,例如:
```
gantt.config.onColumnResize = function (index, width, element) {
console.log("Column " + index + " resized to width " + width);
};
```
当用户调整列宽度时,将会触发该回调函数,并输出调整后的列索引和宽度。
阅读全文
相关推荐


















