Dhtmlx KanBan 付费版使用

TypeScript 复制代码
<template>
  <div v-if="isShowToolbar" ref="toolbarRef" class="kanban-toolbar"></div>
  <div ref="kanbanRef" class="kanban"></div>
</template>

<script lang="ts" setup>
import {  computed, onMounted, ref } from "vue";
import { kanban } from "./lib/kanban.dev.js";
import "./lib/kanban.css";
import { kanbanProps } from "./kanban";
import zhCN from "./locale/zh-CN";
defineOptions({ name: "Kanban" });
const {
  columns,
  columnsConfig,
  cards,
  cardConfig,
  cardHeight,
  editor,
  editorConfig,
  history,
  readonly,
  locale,
  isToolbar,
} = defineProps(kanbanProps);
const kanbanRef = ref();
const kanbanInstance = ref();
const toolbarRef = ref();
const toolbarInstance = ref();
const isShowToolbar = computed<boolean>(() => isToolbar);
const { Kanban, Toolbar, defaultEditorShape } = kanban;
onMounted(() => {
  kanbanInstance.value = new Kanban(kanbanRef.value, {
    cards: cards,
    cardShape: cardConfig,
    columns: columns,
    columnShape: columnsConfig,
    editor: editor,
    editorShape: editorConfig,
    cardHeight: cardHeight,
    history: history,
    readonly: readonly,
    locale: locale === "cn" ? zhCN : "en",
  });

  toolbarInstance.value = new Toolbar(toolbarRef.value, {
      api: kanbanInstance.value.api,
  });
});

defineExpose({
  instance: kanbanInstance,
});
</script>
相关推荐
宁雨桥44 分钟前
Vue项目中iframe嵌入页面实现免登录的完整指南
前端·javascript·vue.js
LongJ_Sir1 小时前
Cesium--可拖拽气泡弹窗(对话框尾巴,Vue3版)
前端·javascript·vue.js
一 乐1 小时前
在线考试|基于springboot + vue在线考试系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·后端·课程设计
qq_12498707531 小时前
基于spring boot的调查问卷系统的设计与实现(源码+论文+部署+安装)
java·vue.js·spring boot·后端·spring·毕业设计·计算机毕业设计
EndingCoder2 小时前
高级项目:构建一个 CLI 工具
大数据·开发语言·前端·javascript·elasticsearch·搜索引擎·typescript
风之舞_yjf2 小时前
Vue基础(26)_单文件组件
前端·vue.js
weixin_422201302 小时前
Element Plus中el-tree组件默认选中第一个节点的实现方法
前端·javascript·vue.js
css趣多多2 小时前
组件没有原生事件
前端·javascript·vue.js
小小弯_Shelby2 小时前
el-form表单简洁有效地解决新增与查看详情共用一个页面问题,控制el-form的disabled设置和修改样式
前端·vue.js·elementui
要加油哦~2 小时前
vue | 重启 TS Server / Vite
前端·javascript·vue.js