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

1 line
3.3 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d229d67"],{dec3:function(s,t,e){"use strict";e.r(t);var a=function(){var s=this;s._self._c;return s._m(0)},n=[function(){var s=this,t=s._self._c;return t("div",[t("h1",[s._v("Formula plugin")]),t("blockquote",[t("p",[s._v("v0.7.2+")])]),t("blockquote",[t("p",[s._v("This plugin is only supported in rich text mode, so it needs to be used after registering the RichText plugin")])]),t("p",[s._v("This plugin is used to support inserting formulas into nodes.")]),t("blockquote",[t("p",[s._v("注意:公式是通过"),t("a",{attrs:{href:"https://github.com/KaTeX/KaTeX"}},[s._v("KaTeX")]),s._v("库实现的,"),t("code",[s._v("KaTeX")]),s._v("提供了一些配置,插件默认的一个配置是:")])]),t("blockquote",[t("p",[s._v("Note: The formula is implemented through the "),t("a",{attrs:{href:"https://github.com/KaTeX/KaTeX"}},[s._v("KaTeX")]),s._v(" library, and 'KaTeX' provides some configurations. The default configuration for the plugin is:")])]),t("pre",{staticClass:"hljs"},[t("code",[s._v("{\n "),t("span",{staticClass:"hljs-attr"},[s._v("output")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'mathml'")]),s._v("\n}\n")])]),t("blockquote",[t("p",[s._v("This formula may not render successfully on a few browsers. If you need to be compatible with these browsers, you can consider changing the configuration to 'HTML'. For detailed documentation, please refer to "),t("a",{attrs:{href:"https://katex.org/docs/options"}},[s._v("Options")]),s._v(". Using this configuration may require the introduction of a 'KaTeX' style file, which you can test on your own.")])]),t("h2",[s._v("Register")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" MindMap "),t("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),t("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map'")]),s._v("\n"),t("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" Formula "),t("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),t("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map/src/plugins/Formula.js'")]),s._v("\n\nMindMap.usePlugin(Formula)\n")])]),t("p",[s._v("After registration and instantiation of "),t("code",[s._v("MindMap")]),s._v(", the instance can be obtained through "),t("code",[s._v("mindMap.formula")]),s._v(".")]),t("h2",[s._v("Usage")]),t("p",[s._v("After registering the plugin, you can use the command 'INSERT_FORMULA' to insert the specified formula for the node:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("mindMap.execCommand("),t("span",{staticClass:"hljs-string"},[s._v("'INSERT_FORMULA'")]),s._v(", "),t("span",{staticClass:"hljs-string"},[s._v("'a^2'")]),s._v(")\n")])]),t("p",[s._v("The above command will insert the 'a^2' formula into the currently active node.")]),t("p",[s._v("If you want to assign a formula to a node or nodes, you can pass the second parameter:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("mindMap.execCommand("),t("span",{staticClass:"hljs-string"},[s._v("'INSERT_FORMULA'")]),s._v(", "),t("span",{staticClass:"hljs-string"},[s._v("'a^2'")]),s._v(", [Node])\n")])]),t("p",[s._v("Pass in the specified node instance through the second parameter.")])])}],o={},i=o,r=e("2877"),l=Object(r["a"])(i,a,n,!1,null,null,null);t["default"]=l.exports}}]);