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>
相关推荐
夕水22 分钟前
一个小小的颜色选择器,差点让我开发出一个组件库来
前端·javascript·typescript
Soujer1 小时前
OpenPrint:零后端依赖的开源 Web 打印模板设计器
typescript·开源·打印设计器·web打印·静默打印
Amumu121381 小时前
TypeScript学习: 基本类型(一)
开发语言·前端·typescript
光影少年2 小时前
ts全栈开发
javascript·后端·typescript·node.js·c5全栈
Setsuna_F_Seiei14 小时前
性能优化 - 列表分页查询的优化
前端·vue.js·性能优化
Setsuna_F_Seiei14 小时前
性能优化 - Vue.js 的懒加载的优化封装
前端·vue.js·性能优化
小码哥06818 小时前
租房平台源码部署验收:房源样例、区域字典与看房预约逐项验证
前端·javascript·vue.js·租房小程序·租房系统·租房软件
濮水大叔21 小时前
Cabloy/Zova 与 Next.js 的布局组件差异:从目录嵌套到路由应用壳
前端·typescript·next.js
1-1=01 天前
Vue 全局事件总线
前端·javascript·vue.js
徐小夕1 天前
JitKnow AI知识库:把任何文档,一键变成可访问和可配置的Wiki站点
前端·vue.js·github