- Notifications
You must be signed in to change notification settings - Fork17
基于fex-team/kityminder-core和Vue2封装的在线脑图编辑功能
License
AgAngle/vue-minder-editor-plus
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
该项目是参考vue-mindeditor 以及kityminder-editor源码,基于kityminder-core 实现
npm install vue-minder-editor-plus --save
importvueMinderEditorfrom'vue-minder-editor-plus'importVuefrom'vue'Vue.use(vueMinderEditor)
<template><div><minder-editor:progress-enable="false":import-json="importJson"/></div></template><script>importminderEditorfrom'../../dist/static/js/vueMinderEditor'importvuefrom'vue'vue.use(minderEditor);exportdefault{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>
# 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
// 方式一import locale from '/src/locale/lang/en-US'Vue.use(vueMinderEditorPlus, { locale});// 方式二import lang from '/src/locale/lang/en-US'import locale from '/src/locale'locale.use(lang)Vue.use(vueMinderEditorPlus);// 方式三import Vue from 'vue';import VueI18n from 'vue-i18n';import enLocale from 'vue-minder-editor-plus/src/locale/lang/en-US';import zhLocale from 'vue-minder-editor-plus/src/locale/lang/zh-CN';import vueMinderEditor from 'vue-minder-editor-plus';const messages = { en: { message: 'hello', ...enLocale }, zh: { message: '你好', ...zhLocale }}Vue.use(VueI18n);const i18n = new VueI18n({ locale: 'en', // set locale messages, // set locale messages})Vue.use(vueMinderEditor, { i18n: (key, value) => i18n.t(key, value)});以下配置部分为 kityminder-core 扩展的功能,kityminder-core 本身的 minder 对象提供了丰富的功能,使用该组件时可通过 window.minder 对象获取 minder 对象具体的使用方法,可以参考它的文档扩展kityminder-core wiki
type Object
Default: null
需要脑图解析的 js 对象,参数详情可参考上文 demo,或者调用 minder.exportJson() 查看具体参数
type: Number
default: 500
显示高度,默认 500px
type: Boolean
default: null
是否禁止编辑
type: Number
default: 3
外观设置中样式的默认值
type: Boolean
default: true
是否启用优先级功能
type: Boolean
default: true
是否启用标签功能
type: Boolean
default: true
是否启用完成进度功能
type: Boolean
default: true
是否启用上移下移功能
type: Boolean
default: true
是否启用外观样式
type: Boolean
default: true
是否启用展示模式
type: Boolean
default: true
是否启用整理布局
type: Boolean
default: true
是否启用样式编辑
type: Boolean
default: true
是否启用字体编辑
type Number
default: 4
优先级最大显示数量,最多支持显示 9 个级别
type: Boolean
default: true
优先级是否从 0 开始
type: String
default: 'P'优先级显示的前缀
type: Function
default: null
优先级设置的回调函数,如果返回 false 则无法设置优先级
type: Array
default: []
标签选项
type: Array
default: []
定义排他标签,比如 ['tag1','tag2'] ,则 tag1 不能和 tag2 共存
type: Function
default: null
菜单栏是否允许打标签的回调函数,返回 false 则不允许打标签
type: Function
default: null
打标签时的回调函数,返回 false 则打标签不成功
About
基于fex-team/kityminder-core和Vue2封装的在线脑图编辑功能
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Languages
- JavaScript59.8%
- Vue31.9%
- SCSS8.2%
- HTML0.1%