0.7.5 • Published 2 years ago

ch-vue3-mindmap v0.7.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

ch-vue3-mindmap

Mindmap component for Vue3. Fork from https://github.com/hellowuxin/vue3-mindmap/

Install

npm install ch-vue3-mindmap

PROPS

NameTypeDefaultDescription
v-modelData[]undefined设置思维导图数据
x-gapNumber84设置节点横向间隔
y-gapNumber18设置节点纵向间隔
branchNumber4设置连线的宽度
scale-extentNumber, Number0.1, 0.8设置缩放范围
timetravelBooleanfalse是否显示撤销重做按钮
dragBooleanfalse设置节点是否可拖拽
zoomBooleanfalse是否可缩放、拖移
editBooleanfalse是否可编辑
center-btnBooleanfalse是否显示居中按钮
fit-btnBooleanfalse是否显示缩放按钮
add-node-btnBooleanfalse是否显示添加节点按钮
download-btnBooleanfalse是否显示下载按钮
sharp-cornerBooleanfalse设置分支为圆角或直角
ctmBooleanfalse是否响应右键菜单
locale'zh' \ 'en' \ 'ptBR''zh'i18n

Example

<template>
    <mindmap v-model="data"></mindmap>
</template>

<script>
import mindmap from 'ch-vue3-mindmap'

export default defineComponent({
    components: {mindmap},
    setup ()
=>
{
    const data = [{
        "name": "Computer programming",
        "children": [
            {
                "name": "Web",
                "children": [
                    {"name": "HTML & CSS"},
                    {"name": "JavaScript"},
                ]
            },
            {
                "name": "Windows",
                "collapse": true,
                "children": [{"name": "C#"}]
            },
            {"name": "Other", "left": true},
        ]
    }]

    return {data}
}
})
</script>