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>
相关推荐
学以智用23 分钟前
Vue 3 项目核心配置文件详解
前端·vue.js
Din18 小时前
主动取消的防抖
前端·javascript·typescript
决斗小饼干18 小时前
跨语言移植手记:把 TypeScript 的 Codex SDK 请进 .NET 世界
前端·javascript·typescript
优秀稳妥的JiaJi19 小时前
分享一篇后台管理系统的通用skills
前端·vue.js·前端框架
青青家的小灰灰19 小时前
Pinia 完全指南:重构你的 Vue 3 状态管理架构
前端·javascript·vue.js
阿懂在掘金19 小时前
为什么写 Vue 强烈建议用 Setup?除了复用,更是代码组织
前端·vue.js
前端Hardy20 小时前
别再被setTimeout闭包坑了!90% 的人都写错过这个经典循环
前端·javascript·vue.js
卤蛋fg61 天前
vxe-table 如何实现分组列头折叠列功能
vue.js
小怪点点1 天前
vue3使用
前端·vue.js
学以智用1 天前
Vue 3 核心函数全解(组合式 API + 常用工具函数)
javascript·vue.js