mind-map/dist/js/chunk-2d0b92c3.js
街角小林 06c4809b7b update
2023-12-07 09:45:22 +08:00

1 line
2.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0b92c3"],{"328f":function(e,t,o){"use strict";o.r(t);var n=function(){var e=this;e._self._c;return e._m(0)},a=[function(){var e=this,t=e._self._c;return t("div",[t("h1",[e._v("KeyboardNavigation plugin")]),t("blockquote",[t("p",[e._v("v0.2.17+")])]),t("p",[t("code",[e._v("KeyboardNavigation")]),e._v(" plugin provides keyboard navigation function, that is, when you press the direction key, it will automatically find the next node and activate it.")]),t("h2",[e._v("Register")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[e._v("import")]),e._v(" MindMap "),t("span",{staticClass:"hljs-keyword"},[e._v("from")]),e._v(" "),t("span",{staticClass:"hljs-string"},[e._v("'simple-mind-map'")]),e._v("\n"),t("span",{staticClass:"hljs-keyword"},[e._v("import")]),e._v(" KeyboardNavigation "),t("span",{staticClass:"hljs-keyword"},[e._v("from")]),e._v(" "),t("span",{staticClass:"hljs-string"},[e._v("'simple-mind-map/src/plugins/KeyboardNavigation.js'")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// import KeyboardNavigation from 'simple-mind-map/src/KeyboardNavigation.js' Use this path for versions below v0.6.0")]),e._v("\n\nMindMap.usePlugin(KeyboardNavigation)\n")])]),t("p",[e._v("After registration and instantiation of "),t("code",[e._v("MindMap")]),e._v(", the instance can be obtained through "),t("code",[e._v("mindMap.keyboardNavigation")]),e._v(".")]),t("h2",[e._v("Methods")]),t("h3",[e._v("focus(dir)")]),t("p",[t("code",[e._v("dir")]),e._v("Which direction to find the next nodeOptional value"),t("code",[e._v("Left")]),e._v("、 "),t("code",[e._v("Up")]),e._v("、 "),t("code",[e._v("Right")]),e._v("、 "),t("code",[e._v("Down")])]),t("p",[e._v("Focus on the next node")]),t("h3",[e._v("getNodeRect(node)")]),t("p",[t("code",[e._v("node")]),e._v("Node")]),t("p",[e._v("Get the location information of the node and return an object:")]),t("pre",{staticClass:"hljs"},[t("code",[e._v("{\n left,\n top,\n right,\n bottom\n}\n")])]),t("h3",[e._v("getDistance(node1Rect, node2Rect)")]),t("p",[t("code",[e._v("node1Rect")]),e._v("、"),t("code",[e._v("node2Rect")]),e._v("The location data of nodes can be obtained through the "),t("code",[e._v("getNodeRect(node)")])]),t("p",[e._v("Get the distance between two nodes")]),t("h3",[e._v("getCenter(nodeRect)")]),t("p",[t("code",[e._v("nodeRect")]),e._v("The location data of nodes can be obtained through the "),t("code",[e._v("getNodeRect(node)")])]),t("p",[e._v("Get the center point of the node")])])}],i={},s=i,d=o("2877"),v=Object(d["a"])(s,n,a,!1,null,null,null);t["default"]=v.exports}}]);