Code Monkey home page Code Monkey logo

vue-minder-editor-plus's Introduction

Vue-MindEditor based on fex-team/kityminder-core

该项目是参考 vue-mindeditor 以及 kityminder-editor 源码,基于 kityminder-core 实现

install

npm install vue-minder-editor-plus --save

Usage

import vueMinderEditor from 'vue-minder-editor-plus'
import Vue from 'vue'
Vue.use(vueMinderEditor)

component

<template>
  <div>
    <minder-editor :progress-enable="false" :import-json="importJson"/>
  </div>
</template>

<script>
import minderEditor from '../../dist/static/js/vueMinderEditor'
import vue from 'vue'
vue.use(minderEditor);
export default {
  name: "test-plugin",
  data() {
    return {
      importJson: {
          // 节点数据
          root: {
            data: {
              // 文本内容
              text: 'vue-minder-editor-plus',
              // 标签
              resource: ['模块1'],
              // 是否禁止修改
              disable: true,
              // 默认展开或折叠,默认是展开的,collapse 可设为折叠
              // expandState: 'collapse',
              // 在 disable 为 true 的情况下,允许添加标签
              tagEnable: true,
              // 在 disable 为 true 的情况下,允许删除节点
              allowDelete: true,
              // 在 disable 为 true 的情况下,允许添加标签,优先级比 tagEnable 高
              allowDisabledTag: true,
            },
            // 子节点
            children: [
              {
                data: {
                  text: 'child1',
                  disable: true,
                  expandState: 'collapse',
                  resource: ['模块2']
                },
                children: [
                  {
                    data: {
                      text: 'child11',
                      disable: true,
                      resource: ['模块2']
                    },
                  },
                  {
                    data: {
                      text: 'child12',
                    }
                  }
                ]
              },
              {
                data: {
                  text: 'child2',
                }
              }
            ]
          },
        },
        tags:  ['模块1','模块2']
      }
    }
  }
}
</script>

Build Setup

# install npm dependencies
    npm install

# serve with hot reload at localhost:8088
    npm run dev

# build for plugin with minification
    npm run build

# License
    BSD-3-Clause License

Props

以下配置部分为 kityminder-core 扩展的功能,kityminder-core 本身的 minder 对象提供了丰富的功能,使用该组件时可通过 window.minder 对象获取 minder 对象具体的使用方法,可以参考它的文档扩展 kityminder-core wiki

基础配置

importJson

type Object
Default: null

需要脑图解析的 js 对象,参数详情可参考上文 demo,或者调用 minder.exportJson() 查看具体参数

height

type: Number
default: 500

显示高度,默认 500px

disabled

type: Boolean
default: null

是否禁止编辑

defaultMold

type: Number
default: 3

外观设置中样式的默认值

启用配置

sequenceEnable

type: Boolean
default: true

是否优先级功能

tagEnable

type: Boolean
default: true

是否启用标签功能

progressEnable

type: Boolean
default: true

是否启用完成进度功能

moveEnable

type: Boolean
default: true

是否启用上移下移功能

优先级配置

priorityCount

type Number
Default: 4

优先级最大显示数量,最多支持显示 9 个级别

priorityStartWithZero

type: Boolean
default: true

优先级是否从 0 开始

priorityPrefix

type: String
default: 'P' 优先级显示的前缀

priorityDisableCheck

type: Function
default: null

优先级设置的回调函数,如果返回 false 则无法设置优先级

标签配置

tags

type: Array
default: []

标签选项

distinctTags

type: Array
default: []

定义排他标签,比如 ['tag1','tag2'] ,则 tag1 不能和 tag2 共存

tagDisableCheck

type: Function
default: null

菜单栏是否允许打标签的回调函数,返回 false 则不允许打标签

tagEditCheck

type: Function
default: null

打标签时的回调函数,返回 false 则打标签不成功

vue-minder-editor-plus's People

Contributors

agangle avatar fudax avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.