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>
相关推荐
csgo打的菜又爱玩3 小时前
Vue 基础(实战模板与命名指南)
前端·javascript·vue.js
gerrgwg5 小时前
Vue-library-start,一个基于Vite的vue组件库开发模板
前端·javascript·vue.js
星晨雪海9 小时前
怎么格式化idea中的vue文件
前端·vue.js·intellij-idea
没事多睡觉6669 小时前
Vue 虚拟列表实现方案详解:三种方法的完整对比与实践
前端·javascript·vue.js
wxr061613 小时前
部署Spring Boot项目+mysql并允许前端本地访问的步骤
前端·javascript·vue.js·阿里云·vue3·springboot
一个很帅的帅哥14 小时前
Vue中的data为什么是函数?
前端·javascript·vue.js·data
小刘鸭地下城15 小时前
深入解析 Vue 的异步 DOM 更新机制:nextTick 的正确使用指南
vue.js
一个很帅的帅哥17 小时前
Vue keep-alive
前端·javascript·vue.js·keep-alive
一条有腹肌的咸鱼20 小时前
vue3+vite+element-plus封装npm插件遇到的问题,求大神搭救
vue.js