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>
相关推荐
云枫晖29 分钟前
Vue3 响应式原理:从零实现 Reactive
前端·vue.js
jason_yang29 分钟前
俄罗斯Yandex地图实战
vue.js·api
daols881 小时前
vxe-table 配置 ajax 加载列表数据,配置分页和查询搜索表单
vue.js·ajax·table·vxe-table
~无忧花开~1 小时前
Vue.config.js配置全攻略
开发语言·前端·javascript·vue.js
默默乄行走2 小时前
wangEditor5在vue中自定义菜单栏--格式刷,上传图片,视频功能
vue.js
G***66912 小时前
前端框架选型:React vs Vue深度对比
vue.js·react.js·前端框架
局i4 小时前
vue简介
前端·javascript·vue.js
yqcoder5 小时前
vue2 和 vue3 中,列表中的 key 值作用
前端·javascript·vue.js
U***49835 小时前
前端TypeScript教程汇总,从基础到高级
前端·javascript·typescript
梵得儿SHI5 小时前
Vue 指令系统:事件处理与表单绑定全解析,从入门到精通
前端·javascript·vue.js·v-model·v-on·表单数据绑定·表单双向绑定