mirror of https://gitee.com/godoos/godoos.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
2.5 KiB
1 lines
2.5 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0bd54e"],{"2c18":function(e,o,v){"use strict";v.r(o);var t=function(){var e=this;e._self._c;return e._m(0)},n=[function(){var e=this,o=e._self._c;return o("div",[o("h1",[e._v("KeyboardNavigation插件")]),o("blockquote",[o("p",[e._v("v0.2.17+")])]),o("p",[o("code",[e._v("KeyboardNavigation")]),e._v("插件提供键盘导航的功能,也就是当你按下方向键时会自动寻找下一个节点并激活")]),o("h2",[e._v("注册")]),o("pre",{staticClass:"hljs"},[o("code",[o("span",{staticClass:"hljs-keyword"},[e._v("import")]),e._v(" MindMap "),o("span",{staticClass:"hljs-keyword"},[e._v("from")]),e._v(" "),o("span",{staticClass:"hljs-string"},[e._v("'simple-mind-map'")]),e._v("\n"),o("span",{staticClass:"hljs-keyword"},[e._v("import")]),e._v(" KeyboardNavigation "),o("span",{staticClass:"hljs-keyword"},[e._v("from")]),e._v(" "),o("span",{staticClass:"hljs-string"},[e._v("'simple-mind-map/src/plugins/KeyboardNavigation.js'")]),e._v("\n"),o("span",{staticClass:"hljs-comment"},[e._v("// import KeyboardNavigation from 'simple-mind-map/src/KeyboardNavigation.js' v0.6.0以下版本使用该路径")]),e._v("\n\nMindMap.usePlugin(KeyboardNavigation)\n")])]),o("p",[e._v("注册完且实例化"),o("code",[e._v("MindMap")]),e._v("后可通过"),o("code",[e._v("mindMap.keyboardNavigation")]),e._v("获取到该实例。")]),o("h2",[e._v("方法")]),o("h3",[e._v("focus(dir)")]),o("p",[o("code",[e._v("dir")]),e._v(":要寻找哪个方向的下一个节点,可选值:"),o("code",[e._v("Left")]),e._v("、 "),o("code",[e._v("Up")]),e._v("、 "),o("code",[e._v("Right")]),e._v("、 "),o("code",[e._v("Down")])]),o("p",[e._v("聚焦到下一个节点")]),o("h3",[e._v("getNodeRect(node)")]),o("p",[o("code",[e._v("node")]),e._v(":节点")]),o("p",[e._v("获取节点的位置信息,返回一个对象:")]),o("pre",{staticClass:"hljs"},[o("code",[e._v("{\n left,\n top,\n right,\n bottom\n}\n")])]),o("h3",[e._v("getDistance(node1Rect, node2Rect)")]),o("p",[o("code",[e._v("node1Rect")]),e._v("、"),o("code",[e._v("node2Rect")]),e._v(":节点的位置数据,可通过"),o("code",[e._v("getNodeRect(node)")]),e._v("方法获取")]),o("p",[e._v("获取两个节点的距离")]),o("h3",[e._v("getCenter(nodeRect)")]),o("p",[o("code",[e._v("nodeRect")]),e._v(":节点的位置数据,可通过"),o("code",[e._v("getNodeRect(node)")]),e._v("方法获取")]),o("p",[e._v("获取节点的中心点")])])}],s={},a=s,_=v("2877"),d=Object(_["a"])(a,t,n,!1,null,null,null);o["default"]=d.exports}}]);
|