mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 22:08:25 +08:00
提取多选节点Select类作为插件
This commit is contained in:
@@ -1,7 +1,17 @@
|
||||
# Select instance
|
||||
# Select plugin
|
||||
|
||||
The `select` instance is responsible for the mouse right-click multi-selection
|
||||
of nodes, and can be obtained through `mindMap.select`
|
||||
The `Select` plugin provides the function of right-clicking to select multiple nodes.
|
||||
|
||||
## Register
|
||||
|
||||
```js
|
||||
import MindMap from 'simple-mind-map'
|
||||
import Select from 'simple-mind-map/src/Select.js'
|
||||
|
||||
MindMap.usePlugin(Select)
|
||||
```
|
||||
|
||||
After registration and instantiation of `MindMap`, the instance can be obtained through `mindMap.select`.
|
||||
|
||||
## Method
|
||||
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>Select instance</h1>
|
||||
<p>The <code>select</code> instance is responsible for the mouse right-click multi-selection
|
||||
of nodes, and can be obtained through <code>mindMap.select</code></p>
|
||||
<h1>Select plugin</h1>
|
||||
<p>The <code>Select</code> plugin provides the function of right-clicking to select multiple nodes.</p>
|
||||
<h2>Register</h2>
|
||||
<pre class="hljs"><code><span class="hljs-keyword">import</span> MindMap <span class="hljs-keyword">from</span> <span class="hljs-string">'simple-mind-map'</span>
|
||||
<span class="hljs-keyword">import</span> Select <span class="hljs-keyword">from</span> <span class="hljs-string">'simple-mind-map/src/Select.js'</span>
|
||||
|
||||
MindMap.usePlugin(Select)
|
||||
</code></pre>
|
||||
<p>After registration and instantiation of <code>MindMap</code>, the instance can be obtained through <code>mindMap.select</code>.</p>
|
||||
<h2>Method</h2>
|
||||
<h3>toPos(x, y)</h3>
|
||||
<p>Convert mouse position to position relative to the container <code>el</code></p>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
|
||||
export default [{"lang":"zh","children":[{"path":"batchExecution","title":"BatchExecution实例"},{"path":"changelog","title":"Changelog"},{"path":"command","title":"Command实例"},{"path":"constructor","title":"构造函数"},{"path":"doExport","title":"Export 插件"},{"path":"drag","title":"Drag插件"},{"path":"introduction","title":"简介"},{"path":"keyboardNavigation","title":"KeyboardNavigation插件"},{"path":"keyCommand","title":"KeyCommand实例"},{"path":"miniMap","title":"MiniMap插件"},{"path":"node","title":"Node实例"},{"path":"render","title":"Render实例"},{"path":"select","title":"Select实例"},{"path":"start","title":"开始"},{"path":"translate","title":"参与翻译"},{"path":"utils","title":"内置工具方法"},{"path":"view","title":"View实例"},{"path":"watermark","title":"Watermark插件"},{"path":"xmind","title":"XMind解析"}]},{"lang":"en","children":[{"path":"batchExecution","title":"batchExecution instance"},{"path":"changelog","title":"Changelog"},{"path":"command","title":"command instance"},{"path":"constructor","title":"Constructor"},{"path":"doExport","title":"Export plugin"},{"path":"drag","title":"Drag plugin"},{"path":"introduction","title":"Introduction"},{"path":"keyboardNavigation","title":"KeyboardNavigation plugin"},{"path":"keyCommand","title":"KeyCommand instance"},{"path":"miniMap","title":"MiniMap plugin"},{"path":"node","title":"Node instance"},{"path":"render","title":"Render instance"},{"path":"select","title":"Select instance"},{"path":"start","title":"Start"},{"path":"translate","title":"Participate in translation"},{"path":"utils","title":"Utility Methods"},{"path":"view","title":"View instance"},{"path":"watermark","title":"Watermark plugin"},{"path":"xmind","title":"XMind parse"}]}]
|
||||
export default [{"lang":"zh","children":[{"path":"batchExecution","title":"BatchExecution实例"},{"path":"changelog","title":"Changelog"},{"path":"command","title":"Command实例"},{"path":"constructor","title":"构造函数"},{"path":"doExport","title":"Export 插件"},{"path":"drag","title":"Drag插件"},{"path":"introduction","title":"简介"},{"path":"keyboardNavigation","title":"KeyboardNavigation插件"},{"path":"keyCommand","title":"KeyCommand实例"},{"path":"miniMap","title":"MiniMap插件"},{"path":"node","title":"Node实例"},{"path":"render","title":"Render实例"},{"path":"select","title":"Select 插件 "},{"path":"start","title":"开始"},{"path":"translate","title":"参与翻译"},{"path":"utils","title":"内置工具方法"},{"path":"view","title":"View实例"},{"path":"watermark","title":"Watermark插件"},{"path":"xmind","title":"XMind解析"}]},{"lang":"en","children":[{"path":"batchExecution","title":"batchExecution instance"},{"path":"changelog","title":"Changelog"},{"path":"command","title":"command instance"},{"path":"constructor","title":"Constructor"},{"path":"doExport","title":"Export plugin"},{"path":"drag","title":"Drag plugin"},{"path":"introduction","title":"Introduction"},{"path":"keyboardNavigation","title":"KeyboardNavigation plugin"},{"path":"keyCommand","title":"KeyCommand instance"},{"path":"miniMap","title":"MiniMap plugin"},{"path":"node","title":"Node instance"},{"path":"render","title":"Render instance"},{"path":"select","title":"Select plugin"},{"path":"start","title":"Start"},{"path":"translate","title":"Participate in translation"},{"path":"utils","title":"Utility Methods"},{"path":"view","title":"View instance"},{"path":"watermark","title":"Watermark plugin"},{"path":"xmind","title":"XMind parse"}]}]
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
# Select实例
|
||||
# Select 插件
|
||||
|
||||
`select`实例负责鼠标右键多选节点操作,可通过`mindMap.select`获取到该实例
|
||||
`Select`插件提供鼠标右键多选节点的功能。
|
||||
|
||||
## 注册
|
||||
|
||||
```js
|
||||
import MindMap from 'simple-mind-map'
|
||||
import Select from 'simple-mind-map/src/Select.js'
|
||||
|
||||
MindMap.usePlugin(Select)
|
||||
```
|
||||
|
||||
注册完且实例化`MindMap`后可通过`mindMap.select`获取到该实例。
|
||||
|
||||
## 方法
|
||||
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>Select实例</h1>
|
||||
<p><code>select</code>实例负责鼠标右键多选节点操作,可通过<code>mindMap.select</code>获取到该实例</p>
|
||||
<h1>Select 插件</h1>
|
||||
<p><code>Select</code>插件提供鼠标右键多选节点的功能。</p>
|
||||
<h2>注册</h2>
|
||||
<pre class="hljs"><code><span class="hljs-keyword">import</span> MindMap <span class="hljs-keyword">from</span> <span class="hljs-string">'simple-mind-map'</span>
|
||||
<span class="hljs-keyword">import</span> Select <span class="hljs-keyword">from</span> <span class="hljs-string">'simple-mind-map/src/Select.js'</span>
|
||||
|
||||
MindMap.usePlugin(Select)
|
||||
</code></pre>
|
||||
<p>注册完且实例化<code>MindMap</code>后可通过<code>mindMap.select</code>获取到该实例。</p>
|
||||
<h2>方法</h2>
|
||||
<h3>toPos(x, y)</h3>
|
||||
<p>转换鼠标位置为相对于容器<code>el</code>的位置</p>
|
||||
|
||||
@@ -27,6 +27,7 @@ import Watermark from 'simple-mind-map/src/Watermark.js'
|
||||
import KeyboardNavigation from 'simple-mind-map/src/KeyboardNavigation.js'
|
||||
import Export from 'simple-mind-map/src/Export.js'
|
||||
import Drag from 'simple-mind-map/src/Drag.js'
|
||||
import Select from 'simple-mind-map/src/Select.js'
|
||||
import Outline from './Outline'
|
||||
import Style from './Style'
|
||||
import BaseStyle from './BaseStyle'
|
||||
@@ -51,6 +52,7 @@ MindMap
|
||||
.usePlugin(Drag)
|
||||
.usePlugin(KeyboardNavigation)
|
||||
.usePlugin(Export)
|
||||
.usePlugin(Select)
|
||||
|
||||
// 注册自定义主题
|
||||
customThemeList.forEach((item) => {
|
||||
|
||||
Reference in New Issue
Block a user