diff --git a/.gitignore b/.gitignore index bf1c383cb..cf78998bc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ node_modules .DS_Store -package-lock.json \ No newline at end of file +dist_electron \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..318ebe89e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021-2023 The MindMap Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 1099dc1e0..03e075a58 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,233 @@ -# web思维导图的简单实现 +
+ + +
+ ++ + + Think + + + + 志斌 + + + + 小土渣的宇宙 + + + + qp + + + + ZXR + + + + 花儿朵朵 + + + + suka + + + + Chris + + + + 水车 + + + + 仓鼠 + + + + 千帆 + + + + 才镇 + + + + 小米bbᯤ²ᴳ + + + + *棐 + + + + Luke + + + + 布林 + + + + 南风 + + + + 蜉蝣撼大叔 + + + + 乙 + + + + 敏 + + + + 沐风牧草 + + + + 有希 + + + + 樊笼 + + + + 达仁科技 + + + + 小逗比 + + + + 天清如愿 + + + + 敬明朗 + + + + 飞箭 + + + + 戚永峰 + + + + moom + + + + 张扬 + +
\ No newline at end of file diff --git a/copy.js b/copy.js new file mode 100644 index 000000000..21af58296 --- /dev/null +++ b/copy.js @@ -0,0 +1,15 @@ +const fs = require('fs') +const path = require('path') + +const src = path.resolve(__dirname, './dist/index.html') +const dest = path.resolve(__dirname, './index.html') + +if (fs.existsSync(dest)) { + fs.unlinkSync(dest) +} + +if (fs.existsSync(src)) { + fs.copyFileSync(src, dest) + fs.unlinkSync(src) +} + diff --git a/dist/css/app.css b/dist/css/app.css new file mode 100644 index 000000000..4ec2146e2 --- /dev/null +++ b/dist/css/app.css @@ -0,0 +1 @@ +*{margin:0;padding:0;box-sizing:border-box}#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#2c3e50}.headerContainer[data-v-1c36e28e]{height:55px;border-bottom:1px solid rgba(60,60,60,.12);flex-shrink:0;display:flex;justify-content:space-between}.headerContainer .left[data-v-1c36e28e]{width:30%;display:flex;align-items:center;justify-content:flex-end}.headerContainer .left .title[data-v-1c36e28e]{width:200px;font-size:24px;font-weight:700;display:flex;align-items:center;cursor:pointer}.headerContainer .left .title img[data-v-1c36e28e]{width:30px;margin-right:10px}.headerContainer .center[data-v-1c36e28e]{display:flex;align-items:center;flex-grow:1;justify-content:flex-end}.headerContainer .center .btn[data-v-1c36e28e]{color:#213547;cursor:pointer;transition:color .5s;margin-right:15px;font-size:14px}.headerContainer .center .btn.active[data-v-1c36e28e],.headerContainer .center .btn[data-v-1c36e28e]:hover{color:#1ea59a}.headerContainer .center .translateBtn[data-v-1c36e28e]{margin-right:15px;font-size:16px;color:#213547;cursor:pointer;margin-top:1px;display:block;font-size:14px}.headerContainer .center a[data-v-1c36e28e]{text-decoration:none;color:rgba(60,60,60,.7);transition:color .5s;margin-right:15px}.headerContainer .center a[data-v-1c36e28e]:last-of-type{margin-right:0}.headerContainer .center a[data-v-1c36e28e]:hover{color:#3c3c3c}.headerContainer .center a .iconfont[data-v-1c36e28e]{font-size:30px}.headerContainer .right[data-v-1c36e28e]{width:20%}.sideBarContainer[data-v-73f8f4b5]{width:30%;overflow-x:hidden;overflow-y:auto;display:flex;justify-content:flex-end;padding-top:60px;padding-bottom:30px;flex-shrink:0}.sideBarContainer .catalogGroupList[data-v-73f8f4b5]{width:200px}.sideBarContainer .catalogGroupList .catalogGroup[data-v-73f8f4b5]{padding-bottom:16px}.sideBarContainer .catalogGroupList .catalogGroup .catalogGroupName[data-v-73f8f4b5]{line-height:20px;font-size:13px;font-weight:600;color:#213547;transition:color .5s;padding:4px 0}.sideBarContainer .catalogGroupList .catalogGroup .catalogList .catalogItem[data-v-73f8f4b5]{line-height:20px;font-size:13px;font-weight:500;color:rgba(60,60,60,.7);transition:color .5s;cursor:pointer;padding:4px 0}.sideBarContainer .catalogGroupList .catalogGroup .catalogList .catalogItem[data-v-73f8f4b5]:hover{color:#3c3c3c}.sideBarContainer .catalogGroupList .catalogGroup .catalogList .catalogItem.active[data-v-73f8f4b5]{color:#1ea59a}.catalogBarContainer[data-v-3cf0fbd6]{width:20%;flex-shrink:0;overflow-x:hidden;overflow-y:auto;padding-top:60px;padding-bottom:30px;padding-left:20px}.catalogBarContainer .catalogBarTitle[data-v-3cf0fbd6]{font-weight:700;margin-bottom:4px;text-transform:uppercase;font-size:11px;letter-spacing:.4px}.catalogBarContainer .catalogList[data-v-3cf0fbd6]{position:relative}.catalogBarContainer .catalogList .catalogItem[data-v-3cf0fbd6]{color:rgba(60,60,60,.7);transition:color .5s;line-height:28px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:500;cursor:pointer}.catalogBarContainer .catalogList .catalogItem.active[data-v-3cf0fbd6]{color:#3c3c3c;font-weight:700}.catalogBarContainer .catalogList .activeBar[data-v-3cf0fbd6]{position:absolute;left:-10px;width:4px;height:20px;background-color:#1ea59a;border-radius:4px;transition:top .25s cubic-bezier(0,1,.5,1),opacity .25s,background-color .5s}.docContainer{position:absolute;left:0;top:0;width:100%;height:100%;display:flex;flex-direction:column;font-family:Quotes,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.docContainer .content{display:flex;flex-grow:1;overflow:hidden}.docContainer .content .doc{overflow:auto;flex-grow:1;font-weight:400;color:#213547;font-size:16px;-webkit-font-smoothing:antialiased;line-height:1.7;padding:30px}.docContainer .content .doc h1{margin:30px 0;font-size:38px;line-height:1.4}.docContainer .content .doc h2{margin:20px 0;border-top:1px solid rgba(60,60,60,.12);font-size:24px;padding-top:10px}.docContainer .content .doc h3{font-size:19px;margin:10px 0}.docContainer .content .doc h4{margin-bottom:10px}.docContainer .content .doc p{margin-bottom:20px}.docContainer .content .doc a{font-weight:500;text-decoration:none;color:#1ea59a;transition:color .25s}.docContainer .content .doc a:hover{color:#33a06f}.docContainer .content .doc pre{margin-bottom:20px;border-radius:5px}.docContainer .content .doc pre,.docContainer .content .doc pre code{font-family:Menlo,Monaco,Consolas,Courier New,monospace}.docContainer .content .doc :not(pre)>code{background-color:#f1f1f1;padding:.15em .5em;border-radius:4px;color:#476582;transition:color .5s,background-color .5s;font-family:Quotes,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.docContainer .content .doc input[type=checkbox]{margin-right:5px}.docContainer .content .doc ul{list-style:none;padding-left:1.25rem}.docContainer .content .doc ul>li{position:relative;margin:1px 0}.docContainer .content .doc ul>li:before{content:"";position:absolute;width:5px;height:5px;border-radius:50%;background-color:rgba(60,60,60,.33);transition:background-color .5s;left:-1.25rem;top:.75rem}.docContainer .content .doc table{border-collapse:collapse;border-spacing:0;margin-top:.8rem;margin-bottom:1.4rem}.docContainer .content .doc tr{background-color:#fff;border-top:1px solid #ccc}.docContainer .content .doc td,.docContainer .content .doc th{padding:5px 14px;border:1px solid #ddd}.docContainer .content .doc blockquote{margin:1rem 0;border-left:.2rem solid rgba(60,60,60,.29);padding-left:1rem;transition:border-color .5s}.docContainer .content .doc blockquote>p{margin:0;font-size:16px;color:rgba(60,60,60,.7);transition:color .5s}@font-face{font-family:iconfont;src:url(../fonts/iconfont.woff2) format("woff2"),url(../fonts/iconfont.woff) format("woff"),url(../fonts/iconfont.ttf) format("truetype")}.iconfont{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icondodeparent:before{content:"\e70f"}.icongongshi:before{content:"\e617"}.icontouming:before{content:"\e60c"}.iconlieri:before{content:"\e60b"}.iconmoon_line:before{content:"\e745"}.iconsousuo:before{content:"\e693"}.iconjiantouyou:before{content:"\e62d"}.iconbianji1:before{content:"\e60a"}.icondaohang1:before{content:"\e632"}.iconyanjing:before{content:"\e8bf"}.iconwangzhan:before{content:"\e628"}.iconcsdn:before{content:"\e608"}.iconshejiaotubiao-10:before{content:"\e644"}.iconstar:before{content:"\e7df"}.iconfork:before{content:"\e641"}.iconxiazai:before{content:"\e613"}.iconteamwork:before{content:"\e870"}.iconshuiyin:before{content:"\e67a"}.iconxmind:before{content:"\ea57"}.iconmouseR:before{content:"\e6bd"}.iconmouseL:before{content:"\e6c0"}.iconwenjian:before{content:"\e607"}.iconpdf:before{content:"\e740"}.iconPNG:before{content:"\ec18"}.iconSVG:before{content:"\e621"}.iconmarkdown:before{content:"\ec04"}.iconjson:before{content:"\ea42"}.iconlianjiexian:before{content:"\e75b"}.iconbangzhu:before{content:"\e620"}.iconshezhi:before{content:"\e8b7"}.iconwushuju:before{content:"\e643"}.iconzuijinliulan:before{content:"\e62f"}.icon3zuidahua-3:before{content:"\e692"}.iconzuixiaohua:before{content:"\e650"}.iconzuidahua:before{content:"\e651"}.iconguanbi:before{content:"\e652"}.icondiannao:before{content:"\eac0"}.iconzhuye:before{content:"\e65c"}.iconbendi1x:before{content:"\e606"}.iconbeijingyanse:before{content:"\e6f8"}.iconqingchu:before{content:"\e605"}.iconcase:before{content:"\e6c6"}.iconxingzhuang-wenzi:before{content:"\eb99"}.iconzitijiacu:before{content:"\ec83"}.iconzitixiahuaxian:before{content:"\ec85"}.iconzitixieti:before{content:"\ec86"}.iconshanchuxian:before{content:"\e612"}.iconzitiyanse:before{content:"\e854"}.icongithub:before{content:"\e64f"}.iconchoose1:before{content:"\e6c5"}.iconzhuti:before{content:"\e7aa"}.icondaochu1:before{content:"\e63e"}.iconlingcunwei:before{content:"\e657"}.iconexport:before{content:"\e642"}.icondakai:before{content:"\ebdf"}.iconxinjian:before{content:"\e64e"}.iconjianqie:before{content:"\e601"}.iconzhengli:before{content:"\e83b"}.iconfuzhi:before{content:"\e604"}.iconniantie:before{content:"\e63f"}.iconshangyi:before{content:"\e6be"}.iconxiayi:before{content:"\e6bf"}.icongaikuozonglan:before{content:"\e609"}.iconquanxuan:before{content:"\f199"}.icondaoru:before{content:"\e6a3"}.iconhoutui-shi:before{content:"\e656"}.iconqianjin1:before{content:"\e654"}.iconwithdraw:before{content:"\e603"}.iconqianjin:before{content:"\e600"}.iconhuifumoren:before{content:"\e60e"}.iconhuanhang:before{content:"\e61e"}.iconsuoxiao:before{content:"\ec13"}.iconbianji:before{content:"\e626"}.iconfangda:before{content:"\e663"}.iconquanping1:before{content:"\e664"}.icondingwei:before{content:"\e616"}.icondaohang:before{content:"\e611"}.iconjianpan:before{content:"\e64d"}.iconquanping:before{content:"\e602"}.icondaochu:before{content:"\e63d"}.iconbiaoqian:before{content:"\e63c"}.iconflow-Mark:before{content:"\e65b"}.iconchaolianjie:before{content:"\e6f4"}.iconjingzi:before{content:"\e610"}.iconxiaolian:before{content:"\e60f"}.iconimage:before{content:"\e629"}.iconjiegou:before{content:"\e61d"}.iconyangshi:before{content:"\e631"}.iconfuhao-dagangshu:before{content:"\e71f"}.icontianjiazijiedian:before{content:"\e622"}.iconjiedian:before{content:"\e655"}.iconshanchu:before{content:"\e696"}.iconzhankai:before{content:"\e64c"}.iconzhankai1:before{content:"\e673"} \ No newline at end of file diff --git a/dist/css/chunk-38caf5df.css b/dist/css/chunk-38caf5df.css new file mode 100644 index 000000000..8a69d09d7 --- /dev/null +++ b/dist/css/chunk-38caf5df.css @@ -0,0 +1,22 @@ +@charset "utf-8";.imgUploadContainer[data-v-72b759f7]{width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:hsla(0,0%,100%,.9);z-index:1000}.imgUploadContainer .imgUploadPanel[data-v-72b759f7]{position:relative;width:100%;font-size:22px;white-space:nowrap;color:#909090;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.imgUploadContainer .imgUploadPanel .title[data-v-72b759f7]{margin-bottom:15px;font-size:22px;font-weight:700;color:hsla(218,9%,51%,.8)}.imgUploadContainer .imgUploadPanel .closeBtn[data-v-72b759f7]{position:absolute;right:25px;top:32px;cursor:pointer}.imgUploadContainer .imgUploadPanel .imgUploadInputArea[data-v-72b759f7]{display:block;width:100%;height:200px;font-size:20px;color:rgba(51,51,51,.4);background-color:hsla(0,0%,87%,.6);border:none;outline:none;cursor:pointer;text-align:center;display:flex;justify-content:center;align-items:center;white-space:normal;padding:10px}.imgUploadContainer .imgUploadPanel #imgUploadInput[data-v-72b759f7]{display:none}.imgUploadContainer .imgUploadPanel .uploadInfoBox[data-v-72b759f7]{position:relative;width:100%;height:200px;background-color:hsla(0,0%,87%,.6)}.imgUploadContainer .imgUploadPanel .uploadInfoBox .previewBox[data-v-72b759f7]{width:100%;height:100%;background-size:contain;background-repeat:no-repeat;background-position:50%}.imgUploadContainer .imgUploadPanel .uploadInfoBox .delBtn[data-v-72b759f7]{position:absolute;right:0;top:0;cursor:pointer;width:20px;height:20px;background-color:#fff}.nodeImageDialog .title[data-v-75db42de]{font-size:18px;margin-bottom:12px}.nodeImageDialog .inputBox[data-v-75db42de]{display:flex;align-items:center;margin-bottom:10px}.nodeImageDialog .inputBox .label[data-v-75db42de]{width:150px}.nodeHyperlinkDialog .item[data-v-36243570]{display:flex;align-items:center;margin-bottom:10px}.nodeHyperlinkDialog .item .name[data-v-36243570]{display:block;width:50px}.nodeIconDialog[data-v-60ef0f27] .el-dialog__body{padding:0 20px}.nodeIconDialog .deleteBtn[data-v-60ef0f27]{margin-bottom:20px}.nodeIconDialog .item[data-v-60ef0f27]{margin-bottom:20px;font-weight:700}.nodeIconDialog .item .title[data-v-60ef0f27]{margin-bottom:10px}.nodeIconDialog .item .list[data-v-60ef0f27]{display:flex;flex-wrap:wrap}.nodeIconDialog .item .list .icon[data-v-60ef0f27]{width:24px;height:24px;margin-right:10px;margin-bottom:10px;cursor:pointer;position:relative}.nodeIconDialog .item .list .icon[data-v-60ef0f27] img,.nodeIconDialog .item .list .icon[data-v-60ef0f27] svg{width:100%;height:100%}.nodeIconDialog .item .list .icon.selected[data-v-60ef0f27]:after{content:"";position:absolute;left:-4px;top:-4px;width:28px;height:28px;border-radius:50%;border:2px solid #409eff} + +/*! + * @toast-ui/editor + * @version 3.2.1 | Thu Sep 29 2022 + * @author NHN Cloud FE Development Lab${ce(e)}
`).join("")},K=(e,t)=>{const n={};return Object.keys(t).forEach(i=>{const a=e[i],o=t[i];if(M(a)===M(o)){if("Object"===M(a)){if(JSON.stringify(a)!==JSON.stringify(o))return void(n[i]=o)}else if(a!==o)return void(n[i]=o)}else n[i]=o}),n},Q=e=>!/^_/.test(e)&&!a["i"].includes(e),J=e=>e.reduce((e,t)=>{const n=e.find(e=>e.type===t.type);return n?t.list.forEach(e=>{const t=n.list.find(t=>t.name===e.name);t?t.icon=e.icon:n.list.push(e)}):e.push({...t}),e},[]),V=e=>{let t=[];return e.forEach(n=>{e.find(e=>e.uid!==n.uid&&e.isAncestor(n))||t.push(n)}),t},X=e=>{const t={},n={};e.forEach(e=>{const i=e.parent;if(i){const a=i.uid;n[a]=i;const o=e.getIndexInBrothers(),r={node:e,index:o};t[a]?t[a].find(e=>e.index===r.index)||t[a].push(r):t[a]=[r]}});const i=[];return Object.keys(t).forEach(e=>{if(t[e].length>1){const a=t[e].map(e=>e.index).sort((e,t)=>e-t);i.push({node:n[e],range:[a[0],a[a.length-1]]})}else i.push({node:t[e][0].node})}),i},q=(e,t,n,i,a,o,r,l)=>t>a&&o>e&&i>r&&l>n,ee=e=>{let t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),n.collapse(),t.removeAllRanges(),t.addRange(n)},te=e=>{let t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)},ne=(e,t={})=>{const n=e=>{e.forEach(e=>{e.data={...e.data,...t},e.children&&e.children.length>0&&n(e.children)})};return n(e),e},ie=(e,t=!1)=>{const n=e=>{e.forEach(e=>{e.data||(e.data={}),(t||_(e.data.uid))&&(e.data.uid=L()),e.children&&e.children.length>0&&n(e.children)})};return n(e),e},ae=e=>e?Array.isArray(e)?e:[e]:[],oe=e=>e.parent?e.parent.nodeData.children.findIndex(t=>t.data.uid===e.uid):0,re=(e,t)=>t.findIndex(t=>t.uid===e.uid),le=e=>{let t=0;for(let a=0;a")]),e._v(" into text wrapped in "),t("code",[e._v("\\n")]),e._v(".")]),t("h4",[e._v("textToNodeRichTextWithWrap(html)")]),t("blockquote",[t("p",[e._v("v0.6.12+")])]),t("p",[e._v("Convert the wrapped text of "),t("code",[e._v("
")]),e._v(" into node rich text content in the form of "),t("code",[e._v("
")]),e._v(".")]),t("h4",[e._v("isMobile()")]),t("blockquote",[t("p",[e._v("v0.6.13+")])]),t("p",[e._v("Determine if it is a mobile environment.")]),t("h4",[e._v("getTopAncestorsFomNodeList(list)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("list")]),e._v(": Arrray, Node instance list.")])]),t("p",[e._v("Find the top-level node list from the node instance list.")]),t("h4",[e._v("checkTwoRectIsOverlap(minx1, maxx1, miny1, maxy1, minx2, maxx2, miny2, maxy2)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("p",[e._v("The parameter is the position of two rectangles.")]),t("p",[e._v("Determine if two rectangles overlap.")]),t("h4",[e._v("focusInput(el)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("el")]),e._v(": DOM nodes, elements that can be focused, typically input box elements.")])]),t("p",[e._v("Focus on the specified input box.")]),t("h4",[e._v("selectAllInput(el)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("el")]),e._v(": DOM nodes, elements that can be focused, typically input box elements.")])]),t("p",[e._v("Focus and select all specified input boxes.")]),t("h4",[e._v("addDataToAppointNodes(appointNodes, data = {})")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("p",[t("code",[e._v("appointNodes")]),e._v(":Node instance list, array type.")])]),t("li",[t("p",[t("code",[e._v("data")]),e._v(":The data to be attached to all nodes in the specified node instance list tree.")])])]),t("p",[e._v("Adding additional data to the specified node list tree data will modify the original data.")]),t("h4",[e._v("createUidForAppointNodes(appointNodes, createNewId)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("p",[t("code",[e._v("appointNodes")]),e._v(":Node instance list, array type.")])]),t("li",[t("p",[t("code",[e._v("createNewId")]),e._v(":v0.7.3-fix.1+, "),t("code",[e._v("Boolean")]),e._v(", default is "),t("code",[e._v("false")]),e._v(", If the node does not have a 'uid', a new 'uid' will be created. If 'true' is passed, a new 'uid' will be created regardless of whether the node data originally exists or not`")])])]),t("p",[e._v("Adding a uid to the specified node list tree data (if the uid does not exist) will modify the original data.")]),t("h4",[e._v("getNodeIndex(node)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("node")]),e._v(":Node instance.")])]),t("p",[e._v("Gets the position index of a node within its peers.")]),t("h4",[e._v("mergerIconList(list)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("list")]),e._v(":The array of node icons to be merged into the library.")])]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-comment"},[e._v("// const data = [")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'b' }] },")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// { type: 'priority', name: '优先级图标', list: [{ name: '2', icon: 'c' }, { name: 3, icon: 'd' }] },")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// ];")]),e._v("\n\n"),t("span",{staticClass:"hljs-comment"},[e._v("// mergerIconList(data) result:")]),e._v("\n\n"),t("span",{staticClass:"hljs-comment"},[e._v("// [")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'c' }, { name: 3, icon: 'd' }] },")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// ]")]),e._v("\n")])]),t("p",[e._v("Merge icon arrays.")]),t("h4",[e._v("htmlEscape(str)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("str")]),e._v(":String.")])]),t("p",[e._v("Escape the incoming string, currently escaping the following three characters:")]),t("pre",{staticClass:"hljs"},[t("code",[e._v("& -> &\n< -> <\n> -> >\n")])]),t("h4",[e._v("generateColorByContent(str)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("str")]),e._v(":String.")])]),t("p",[e._v("Generate colors based on incoming content, and the same content will generate the same color.")]),t("h4",[e._v("isSameObject(a, b)")]),t("blockquote",[t("p",[e._v("v0.7.3+")])]),t("ul",[t("li",[t("code",[e._v("a")]),e._v("、"),t("code",[e._v("b")]),e._v(": Object | Array, Two objects to compare")])]),t("p",[e._v("Determine whether two objects are the same, only handling objects or arrays.")]),t("h4",[e._v("getNodeDataIndex(node)")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("p",[e._v("Gets the position index of a node within its sibling nodes.")]),t("h4",[e._v("getNodeIndexInNodeList(node, nodeList)")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("p",[e._v("Find the index of a node from a list of nodes.")]),t("h4",[e._v("setDataToClipboard(data)")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("ul",[t("li",[t("code",[e._v("data")]),e._v(":Object | Array")])]),t("p",[e._v("Set data to the user clipboard.")]),t("h4",[e._v("getDataFromClipboard()")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("p",[e._v("Reading text and images from the user's clipboard returns:")]),t("pre",{staticClass:"hljs"},[t("code",[e._v("{\n text,\n img\n}\n")])]),t("h4",[e._v("removeFromParentNodeData(node)")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("p",[e._v("Remove the data of a node from its parent node's "),t("code",[e._v("nodeData.children")]),e._v(" list.")]),t("h4",[e._v("checkHasSupSubRelation()")]),t("blockquote",[t("p",[e._v("v0.8.1+")])]),t("p",[e._v("Determine whether there is a hierarchical relationship from the given node instance list.")]),t("h4",[e._v("handleSelfCloseTags(str)")]),t("blockquote",[t("p",[e._v("v0.9.1+")])]),t("ul",[t("li",[t("code",[e._v("str")]),e._v(": html string")])]),t("p",[e._v("Add a closed state to HTML self closing tags, "),t("code",[e._v('
')]),e._v(" -> "),t("code",[e._v('')]),e._v("。")]),t("h4",[e._v("checkNodeListIsEqual(list1, list2)")]),t("blockquote",[t("p",[e._v("v0.9.1+")])]),t("ul",[t("li",[t("code",[e._v("list1/list2")]),e._v(": Node instance list")])]),t("p",[e._v("Check if the two node instance lists contain the same nodes.")]),t("h2",[e._v("Simulate CSS background in Canvas")]),t("p",[e._v("Import:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[e._v("import")]),e._v(" drawBackgroundImageToCanvas "),t("span",{staticClass:"hljs-keyword"},[e._v("from")]),e._v(" "),t("span",{staticClass:"hljs-string"},[e._v("'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas'")]),e._v("\n")])]),t("p",[e._v("Usage:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[e._v("let")]),e._v(" width = "),t("span",{staticClass:"hljs-number"},[e._v("500")]),e._v("\n"),t("span",{staticClass:"hljs-keyword"},[e._v("let")]),e._v(" height = "),t("span",{staticClass:"hljs-number"},[e._v("500")]),e._v("\n"),t("span",{staticClass:"hljs-keyword"},[e._v("let")]),e._v(" img = "),t("span",{staticClass:"hljs-string"},[e._v("'/1.jpg'")]),e._v("\n"),t("span",{staticClass:"hljs-keyword"},[e._v("let")]),e._v(" canvas = "),t("span",{staticClass:"hljs-built_in"},[e._v("document")]),e._v(".createElement("),t("span",{staticClass:"hljs-string"},[e._v("'canvas'")]),e._v(")\ncanvas.width = width\ncanvas.height = height\ndrawBackgroundImageToCanvas(ctx, width, height, img, {\n "),t("span",{staticClass:"hljs-attr"},[e._v("backgroundRepeat")]),e._v(": "),t("span",{staticClass:"hljs-string"},[e._v("'repeat-y'")]),e._v(",\n "),t("span",{staticClass:"hljs-attr"},[e._v("backgroundSize")]),e._v(": "),t("span",{staticClass:"hljs-string"},[e._v("'60%'")]),e._v(",\n "),t("span",{staticClass:"hljs-attr"},[e._v("backgroundPosition")]),e._v(": "),t("span",{staticClass:"hljs-string"},[e._v("'center center'")]),e._v("\n}, "),t("span",{staticClass:"hljs-function"},[e._v("("),t("span",{staticClass:"hljs-params"},[e._v("err")]),e._v(") =>")]),e._v(" {\n "),t("span",{staticClass:"hljs-keyword"},[e._v("if")]),e._v(" (err) {\n "),t("span",{staticClass:"hljs-comment"},[e._v("// fail")]),e._v("\n } "),t("span",{staticClass:"hljs-keyword"},[e._v("else")]),e._v(" {\n "),t("span",{staticClass:"hljs-comment"},[e._v("// success")]),e._v("\n }\n})\n")])]),t("h2",[e._v("LRU cache class")]),t("blockquote",[t("p",[e._v("v0.5.10+")])]),t("p",[e._v("Import:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[e._v("import")]),e._v(" Lru "),t("span",{staticClass:"hljs-keyword"},[e._v("from")]),e._v(" "),t("span",{staticClass:"hljs-string"},[e._v("'simple-mind-map/src/utils/Lru.js'")]),e._v("\n")])]),t("h3",[e._v("Constructor")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[e._v("let")]),e._v(" lru = "),t("span",{staticClass:"hljs-keyword"},[e._v("new")]),e._v(" Lru(max)\n")])]),t("p",[t("code",[e._v("max")]),e._v(": Specify the maximum number of caches.")]),t("h3",[e._v("Instance properties")]),t("h4",[e._v("size")]),t("p",[e._v("The current number of caches.")]),t("h4",[e._v("pool")]),t("p",[e._v("Get cache pool.")]),t("h3",[e._v("Instance methods")]),t("h4",[e._v("add(key, value)")]),t("p",[e._v("Add cache.")]),t("h4",[e._v("delete(key)")]),t("p",[e._v("Delete cache.")]),t("h4",[e._v("has(key)")]),t("p",[e._v("Check if a cache exists.")]),t("h4",[e._v("get(key)")]),t("p",[e._v("Gets the value of a cache.")])])}],i={},n=i,v=a("2877"),l=Object(v["a"])(n,s,o,!1,null,null,null);t["default"]=l.exports}}]); \ No newline at end of file diff --git a/dist/js/chunk-2d0ab546.js b/dist/js/chunk-2d0ab546.js new file mode 100644 index 000000000..45ec6582a --- /dev/null +++ b/dist/js/chunk-2d0ab546.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0ab546"],{"158d":function(s,t,a){"use strict";a.r(t);var n=function(){var s=this;s._self._c;return s._m(0)},e=[function(){var s=this,t=s._self._c;return t("div",[t("h1",[s._v("如何自定义节点内容")]),t("blockquote",[t("p",[s._v("该特性v0.6.3+版本支持")])]),t("p",[s._v("如果你想自定义节点的内容,那么可以在实例化"),t("code",[s._v("simple-mind-map")]),s._v("时传入以下选项:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("new")]),s._v(" MindMap({\n "),t("span",{staticClass:"hljs-attr"},[s._v("isUseCustomNodeContent")]),s._v(": "),t("span",{staticClass:"hljs-literal"},[s._v("true")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("customCreateNodeContent")]),s._v(": "),t("span",{staticClass:"hljs-function"},[s._v("("),t("span",{staticClass:"hljs-params"},[s._v("node")]),s._v(") =>")]),s._v(" {\n "),t("span",{staticClass:"hljs-comment"},[s._v("// return你的自定义DOM节点")]),s._v("\n }\n})\n")])]),t("p",[t("code",[s._v("customCreateNodeContent")]),s._v("方法会接收当前遍历到的节点实例作为参数,一般而言你会需要该节点的数据,这可以通过如下方式获取:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("node.nodeData.data\n")])]),t("p",[s._v("其他节点实例属性你可以自行打印出来看看。")]),t("p",[t("code",[s._v("customCreateNodeContent")]),s._v("方法需要返回"),t("code",[s._v("DOM")]),s._v("节点,如果某个节点你不想自定义,那么可以返回"),t("code",[s._v("null")]),s._v(",那么还是会走内置的节点渲染逻辑。")]),t("p",[s._v("返回的"),t("code",[s._v("DOM")]),s._v("节点的宽高需要是确定的,如果是动态的那么会导致宽高获取错误,最终导致节点定位错误和发生重叠等问题。")]),t("p",[s._v("如果使用了自定义节点内容,那么内置的插入节点内容的相关方法你都不应该再使用,因为相当于整个节点内容都由你自己控制,另外,节点样式设置也不会再生效,切换主题也只会切换非节点内容的样式,最后,双击节点也不会再进入编辑,所以这个功能一般用于展示性的需求。")]),t("h2",[s._v("示例1:渲染自定义DOM节点")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("{\n "),t("span",{staticClass:"hljs-attr"},[s._v("customCreateNodeContent")]),s._v(": "),t("span",{staticClass:"hljs-function"},[s._v("("),t("span",{staticClass:"hljs-params"},[s._v("node")]),s._v(") =>")]),s._v(" {\n "),t("span",{staticClass:"hljs-keyword"},[s._v("let")]),s._v(" div = "),t("span",{staticClass:"hljs-built_in"},[s._v("document")]),s._v(".createElement("),t("span",{staticClass:"hljs-string"},[s._v("'div'")]),s._v(")\n div.className = "),t("span",{staticClass:"hljs-string"},[s._v("'xxx'")]),s._v("\n div.style.cssText = "),t("span",{staticClass:"hljs-string"},[s._v("`xxx`")]),s._v("\n div.innerHTML = "),t("span",{staticClass:"hljs-string"},[s._v("`\n")]),v._v("形式的节点富文本内容转换成"),e("code",[v._v("\\n")]),v._v("换行的文本。")]),e("h4",[v._v("textToNodeRichTextWithWrap(html)")]),e("blockquote",[e("p",[v._v("v0.6.12+")])]),e("p",[v._v("将"),e("code",[v._v("
")]),v._v("换行的文本转换成"),e("code",[v._v("
")]),v._v("形式的节点富文本内容。")]),e("h4",[v._v("isMobile()")]),e("blockquote",[e("p",[v._v("v0.6.13+")])]),e("p",[v._v("判断是否是移动端环境。")]),e("h4",[v._v("getTopAncestorsFomNodeList(list)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("code",[v._v("list")]),v._v(":Arrray,节点实例列表。")])]),e("p",[v._v("从节点实例列表里找出最顶层的节点列表。")]),e("h4",[v._v("checkTwoRectIsOverlap(minx1, maxx1, miny1, maxy1, minx2, maxx2, miny2, maxy2)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("p",[v._v("参数为两个矩形的位置。")]),e("p",[v._v("判断两个矩形是否重叠。")]),e("h4",[v._v("focusInput(el)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("code",[v._v("el")]),v._v(":DOM节点,可聚焦的元素,一般为输入框元素。")])]),e("p",[v._v("聚焦指定输入框。")]),e("h4",[v._v("selectAllInput(el)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("code",[v._v("el")]),v._v(":DOM节点,可聚焦的元素,一般为输入框元素。")])]),e("p",[v._v("聚焦并全选指定输入框。")]),e("h4",[v._v("addDataToAppointNodes(appointNodes, data = {})")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("p",[e("code",[v._v("appointNodes")]),v._v(":节点实例列表,数组类型。")])]),e("li",[e("p",[e("code",[v._v("data")]),v._v(":要附加到指定节点实例列表树中所有节点的数据中的数据。")])])]),e("p",[v._v("给指定的节点列表树数据添加附加数据,会修改原数据。")]),e("h4",[v._v("createUidForAppointNodes(appointNodes, createNewId)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("p",[e("code",[v._v("appointNodes")]),v._v(":节点实例列表,数组类型。")])]),e("li",[e("p",[e("code",[v._v("createNewId")]),v._v(":v0.7.3-fix.1+,"),e("code",[v._v("Boolean")]),v._v(",默认为"),e("code",[v._v("false")]),v._v(",即如果节点不存在"),e("code",[v._v("uid")]),v._v("的话,会创建新的"),e("code",[v._v("uid")]),v._v("。如果传"),e("code",[v._v("true")]),v._v(",那么无论节点数据原来是否存在"),e("code",[v._v("uid")]),v._v(",都会创建新的"),e("code",[v._v("uid")])])])]),e("p",[v._v("给指定的节点列表树数据添加uid(如果uid不存在的话),会修改原数据。")]),e("h4",[v._v("getNodeIndex(node)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("code",[v._v("node")]),v._v(":节点实例。")])]),e("p",[v._v("获取节点在同级里的位置索引。")]),e("h4",[v._v("mergerIconList(list)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("code",[v._v("list")]),v._v(":要合并到库内部的节点图标数组。")])]),e("pre",{staticClass:"hljs"},[e("code",[e("span",{staticClass:"hljs-comment"},[v._v("// const data = [")]),v._v("\n"),e("span",{staticClass:"hljs-comment"},[v._v("// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'b' }] },")]),v._v("\n"),e("span",{staticClass:"hljs-comment"},[v._v("// { type: 'priority', name: '优先级图标', list: [{ name: '2', icon: 'c' }, { name: 3, icon: 'd' }] },")]),v._v("\n"),e("span",{staticClass:"hljs-comment"},[v._v("// ];")]),v._v("\n\n"),e("span",{staticClass:"hljs-comment"},[v._v("// mergerIconList(data) 结果")]),v._v("\n\n"),e("span",{staticClass:"hljs-comment"},[v._v("// [")]),v._v("\n"),e("span",{staticClass:"hljs-comment"},[v._v("// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'c' }, { name: 3, icon: 'd' }] },")]),v._v("\n"),e("span",{staticClass:"hljs-comment"},[v._v("// ]")]),v._v("\n")])]),e("p",[v._v("合并图标数组。")]),e("h4",[v._v("generateColorByContent(str)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("code",[v._v("str")]),v._v(":字符串。")])]),e("p",[v._v("根据传入的内容生成颜色,同样的内容会生成同样的颜色。")]),e("h4",[v._v("htmlEscape(str)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("code",[v._v("str")]),v._v(":字符串。")])]),e("p",[v._v("转义传入的字符串,目前会转义如下三个字符:")]),e("pre",{staticClass:"hljs"},[e("code",[v._v("& -> &\n< -> <\n> -> >\n")])]),e("h4",[v._v("isSameObject(a, b)")]),e("blockquote",[e("p",[v._v("v0.7.3+")])]),e("ul",[e("li",[e("code",[v._v("a")]),v._v("、"),e("code",[v._v("b")]),v._v(":Object | Array, 要进行对比的两个对象")])]),e("p",[v._v("判断两个对象是否相同,只处理对象或数组。")]),e("h4",[v._v("getNodeDataIndex(node)")]),e("blockquote",[e("p",[v._v("v0.8.0+")])]),e("p",[v._v("获取节点在兄弟节点中的位置索引。")]),e("h4",[v._v("getNodeIndexInNodeList(node, nodeList)")]),e("blockquote",[e("p",[v._v("v0.8.0+")])]),e("p",[v._v("从一个节点列表里找出某个节点的索引。")]),e("h4",[v._v("setDataToClipboard(data)")]),e("blockquote",[e("p",[v._v("v0.8.0+")])]),e("ul",[e("li",[e("code",[v._v("data")]),v._v(":Object | Array")])]),e("p",[v._v("将数据设置到用户剪切板中。")]),e("h4",[v._v("getDataFromClipboard()")]),e("blockquote",[e("p",[v._v("v0.8.0+")])]),e("p",[v._v("从用户剪贴板中读取文字和图片,返回:")]),e("pre",{staticClass:"hljs"},[e("code",[v._v("{\n text,\n img\n}\n")])]),e("h4",[v._v("removeFromParentNodeData(node)")]),e("blockquote",[e("p",[v._v("v0.8.0+")])]),e("p",[v._v("从节点的父节点的"),e("code",[v._v("nodeData.children")]),v._v("列表中移除该节点的数据。")]),e("h4",[v._v("checkHasSupSubRelation()")]),e("blockquote",[e("p",[v._v("v0.8.1+")])]),e("p",[v._v("从给定的节点实例列表里判断是否存在上下级关系。")]),e("h4",[v._v("handleSelfCloseTags(str)")]),e("blockquote",[e("p",[v._v("v0.9.1+")])]),e("ul",[e("li",[e("code",[v._v("str")]),v._v(":html字符串")])]),e("p",[v._v("给html自闭合标签添加闭合状态,"),e("code",[v._v('
')]),v._v(" -> "),e("code",[v._v('')]),v._v("。")]),e("h4",[v._v("checkNodeListIsEqual(list1, list2)")]),e("blockquote",[e("p",[v._v("v0.9.1+")])]),e("ul",[e("li",[e("code",[v._v("list1/list2")]),v._v(":节点实例列表")])]),e("p",[v._v("检查两个节点实例列表包含的节点是否是一样的。")]),e("h2",[v._v("在canvas中模拟css的背景属性")]),e("p",[v._v("引入:")]),e("pre",{staticClass:"hljs"},[e("code",[e("span",{staticClass:"hljs-keyword"},[v._v("import")]),v._v(" drawBackgroundImageToCanvas "),e("span",{staticClass:"hljs-keyword"},[v._v("from")]),v._v(" "),e("span",{staticClass:"hljs-string"},[v._v("'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas'")]),v._v("\n")])]),e("p",[v._v("使用:")]),e("pre",{staticClass:"hljs"},[e("code",[e("span",{staticClass:"hljs-keyword"},[v._v("let")]),v._v(" width = "),e("span",{staticClass:"hljs-number"},[v._v("500")]),v._v("\n"),e("span",{staticClass:"hljs-keyword"},[v._v("let")]),v._v(" height = "),e("span",{staticClass:"hljs-number"},[v._v("500")]),v._v("\n"),e("span",{staticClass:"hljs-keyword"},[v._v("let")]),v._v(" img = "),e("span",{staticClass:"hljs-string"},[v._v("'/1.jpg'")]),v._v("\n"),e("span",{staticClass:"hljs-keyword"},[v._v("let")]),v._v(" canvas = "),e("span",{staticClass:"hljs-built_in"},[v._v("document")]),v._v(".createElement("),e("span",{staticClass:"hljs-string"},[v._v("'canvas'")]),v._v(")\ncanvas.width = width\ncanvas.height = height\ndrawBackgroundImageToCanvas(ctx, width, height, img, {\n "),e("span",{staticClass:"hljs-attr"},[v._v("backgroundRepeat")]),v._v(": "),e("span",{staticClass:"hljs-string"},[v._v("'repeat-y'")]),v._v(",\n "),e("span",{staticClass:"hljs-attr"},[v._v("backgroundSize")]),v._v(": "),e("span",{staticClass:"hljs-string"},[v._v("'60%'")]),v._v(",\n "),e("span",{staticClass:"hljs-attr"},[v._v("backgroundPosition")]),v._v(": "),e("span",{staticClass:"hljs-string"},[v._v("'center center'")]),v._v("\n}, "),e("span",{staticClass:"hljs-function"},[v._v("("),e("span",{staticClass:"hljs-params"},[v._v("err")]),v._v(") =>")]),v._v(" {\n "),e("span",{staticClass:"hljs-keyword"},[v._v("if")]),v._v(" (err) {\n "),e("span",{staticClass:"hljs-comment"},[v._v("// 失败")]),v._v("\n } "),e("span",{staticClass:"hljs-keyword"},[v._v("else")]),v._v(" {\n "),e("span",{staticClass:"hljs-comment"},[v._v("// 成功")]),v._v("\n }\n})\n")])]),e("h2",[v._v("LRU缓存类")]),e("blockquote",[e("p",[v._v("v0.5.10+")])]),e("p",[v._v("引入:")]),e("pre",{staticClass:"hljs"},[e("code",[e("span",{staticClass:"hljs-keyword"},[v._v("import")]),v._v(" Lru "),e("span",{staticClass:"hljs-keyword"},[v._v("from")]),v._v(" "),e("span",{staticClass:"hljs-string"},[v._v("'simple-mind-map/src/utils/Lru.js'")]),v._v("\n")])]),e("h3",[v._v("构造函数")]),e("pre",{staticClass:"hljs"},[e("code",[e("span",{staticClass:"hljs-keyword"},[v._v("let")]),v._v(" lru = "),e("span",{staticClass:"hljs-keyword"},[v._v("new")]),v._v(" Lru(max)\n")])]),e("p",[e("code",[v._v("max")]),v._v(":指定最大缓存数量。")]),e("h3",[v._v("实例属性")]),e("h4",[v._v("size")]),e("p",[v._v("当前缓存的数量。")]),e("h4",[v._v("pool")]),e("p",[v._v("获取缓存池。")]),e("h3",[v._v("实例方法")]),e("h4",[v._v("add(key, value)")]),e("p",[v._v("添加缓存。")]),e("h4",[v._v("delete(key)")]),e("p",[v._v("删除指定缓存。")]),e("h4",[v._v("has(key)")]),e("p",[v._v("检查某个缓存是否存在。")]),e("h4",[v._v("get(key)")]),e("p",[v._v("获取某个缓存的值。")])])}],a={},o=a,l=s("2877"),c=Object(l["a"])(o,t,_,!1,null,null,null);e["default"]=c.exports}}]); \ No newline at end of file diff --git a/dist/js/chunk-2d0c1a01.js b/dist/js/chunk-2d0c1a01.js new file mode 100644 index 000000000..791cb9b2e --- /dev/null +++ b/dist/js/chunk-2d0c1a01.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c1a01"],{"479a":function(e,t,o){"use strict";o.r(t);var n=function(){var e=this;e._self._c;return e._m(0)},r=[function(){var e=this,t=e._self._c;return t("div",[t("h1",[e._v("Contribute")]),t("h2",[e._v("Participate in development")]),t("p",[e._v("If you want to contribute code, you can 'fork' this project and switch to the 'feature' branch for development. After development and testing, you can submit the 'pr' to the 'feature' branch of this project. When submitting, please try to submit functional files as much as possible. Do not submit unnecessary files.")]),t("p",[e._v("Before development, it is best to create a new 'issue' to describe the new features you want to add. We can have sufficient communication first, and when submitting a 'pr', please provide a detailed description of the features you are developing.")]),t("h2",[e._v("Participate in translation")]),t("blockquote",[t("p",[e._v("Thanks for the first version English translation provided by "),t("a",{attrs:{href:"https://github.com/emircanerkul"}},[e._v("Emircan ERKUL")]),e._v(".")]),t("p",[e._v("Due to limited energy, most translations currently use machine translation, so accuracy is inevitably problematic.")]),t("p",[e._v("At present, the 【Course】 section is not translated. If you are interested, please join us.")])]),t("p",[e._v("If you want to participate in the translation of this document, you can clone this repository first.")]),t("p",[e._v("The translated documents are in the "),t("code",[e._v("/web/src/pages/Doc/")]),e._v(" directory, and currently support English("),t("code",[e._v("en")]),e._v(") and Simplified Chinese("),t("code",[e._v("zh")]),e._v(").")]),t("p",[e._v("If you are adding a new language type, you can create a new directory under the "),t("code",[e._v("/web/src/pages/Doc/")]),e._v(" directory, Then create a folder for each chapter, You can also directly copy all chapter directories under the existing language directory for translation, Note that you only need to write the "),t("code",[e._v("index.md")]),e._v(" file, The "),t("code",[e._v("index.vue")]),e._v(" file under the chapter directory is automatically generated by the script according to "),t("code",[e._v("index.md")]),e._v(".")]),t("p",[e._v("If you are adding a translation chapter to an existing language type, You can create a new chapter directory under the target language directory, You only need to create a "),t("code",[e._v("index.md")]),e._v(" file under the directory.")]),t("p",[e._v("After you complete the translation, you can directly submit "),t("code",[e._v("Pull requests")]),e._v(".")]),t("p",[e._v("If you are a front-end programmer and want to run the service, check the effect of the document page, If a new chapter is added, the file "),t("code",[e._v("/web/src/pages/Doc/catalogList.js")]),e._v(" needs to be modified, Select the appropriate location in the "),t("code",[e._v("StartList")]),e._v(" or "),t("code",[e._v("APIList")]),e._v(" array to insert the "),t("code",[e._v("path")]),e._v(" of the new chapter. Then you need to run "),t("code",[e._v("npm run buildDoc")]),e._v(" under the "),t("code",[e._v("web")]),e._v(" directory to compile the directory and route. Finally, run "),t("code",[e._v("npm run serve")]),e._v(" starts the local service. Open the following path to view the document:")]),t("p",[t("code",[e._v("ip:port/#/doc/zh/introduction")])])])}],a={},i=a,c=o("2877"),s=Object(c["a"])(i,n,r,!1,null,null,null);t["default"]=s.exports}}]); \ No newline at end of file diff --git a/dist/js/chunk-2d0c20be.js b/dist/js/chunk-2d0c20be.js new file mode 100644 index 000000000..504afaa31 --- /dev/null +++ b/dist/js/chunk-2d0c20be.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c20be"],{4947:function(t,e,s){"use strict";s.r(e);var a=function(){var t=this;t._self._c;return t._m(0)},n=[function(){var t=this,e=t._self._c;return e("div",[e("h1",[t._v("RichText plugin")]),e("blockquote",[e("p",[t._v("v0.4.0+")])]),e("p",[t._v("This plugin provides the ability to edit rich text of nodes, and takes effect after registration.")]),e("p",[t._v("By default, node editing can only uniformly apply styles to all text in the node. This plugin can support rich text editing effects. Currently, it supports bold, italic, underline, strikethrough, font, font size, color, and backgroundColor. Underline and line height are not supported.")]),e("p",[t._v("The principle of this plugin is to use "),e("a",{attrs:{href:"https://github.com/quilljs/quill"}},[t._v("Quill")]),t._v(" editor implements rich text editing, and then uses the edited "),e("code",[t._v("DOM")]),t._v(" node directly as the text data of the node, and embeds the "),e("code",[t._v("DOM")]),t._v(" node through the "),e("code",[t._v("svg")]),t._v(" "),e("code",[t._v("foreignObject")]),t._v(" tag during rendering.")]),e("blockquote",[e("p",[t._v("The following prompts exist in versions prior to v0.5.6:")]),e("p",[t._v("This also caused a problem, that is, the function of exporting as a picture was affected, The original principle of exporting "),e("code",[t._v("svg")]),t._v(" as an image is very simple, Get the "),e("code",[t._v("svg")]),t._v(" string, and then create the "),e("code",[t._v("blob")]),t._v(" data of the "),e("code",[t._v("type=image/svg+xml")]),t._v(" type. Then use the "),e("code",[t._v("URL.createObjectURL")]),t._v(" method to generate the "),e("code",[t._v("data:url")]),t._v(" data. Then create a "),e("code",[t._v("Image")]),t._v(" tag, use the "),e("code",[t._v("data:url")]),t._v(" as the "),e("code",[t._v("src")]),t._v(" of the image, and finally draw the image on the "),e("code",[t._v("canvas")]),t._v(" object for export, However, after testing, when the "),e("code",[t._v("DOM")]),t._v(" node is embedded in the "),e("code",[t._v("svg")]),t._v(", this method of export will cause errors, and after trying many ways, the perfect export effect cannot be achieved, The current method is to traverse the "),e("code",[t._v("foreignObject")]),t._v(" node in "),e("code",[t._v("svg")]),t._v(", using "),e("a",{attrs:{href:"https://github.com/niklasvh/html2canvas"}},[t._v("html2canvas")]),t._v(" Convert the "),e("code",[t._v("DOM")]),t._v(" node in the "),e("code",[t._v("foreignObject")]),t._v(" node into an image and then replace the "),e("code",[t._v("foreignObject")]),t._v(" node. This method can work, but it is very time-consuming. Because the "),e("code",[t._v("html2canvas")]),t._v(" conversion takes a long time, it takes about 2 seconds to convert a node. This leads to the more nodes, the slower the conversion time. Therefore, it is recommended not to use this plugin if you cannot tolerate the long time of export.")])]),e("blockquote",[e("p",[t._v("The version of "),e("code",[t._v("v0.5.7+")]),t._v(" directly uses "),e("code",[t._v("html2canvas")]),t._v(" to convert the entire "),e("code",[t._v("svg")]),t._v(", which is no longer an issue with speed. However, there is currently a bug where the color of the node does not take effect after export.")])]),e("p",[e("code",[t._v("V0.6.13+")]),t._v(" version uses "),e("a",{attrs:{href:"https://github.com/1904labs/dom-to-image-more"}},[t._v("dom-to-image-more")]),t._v(" Replaced 'html2canvas' to address the issue of ineffective color export for nodes.")]),e("blockquote",[e("p",[t._v("The compatibility of dom to image more is relatively poor, and exported images are empty on many browsers, so you can replace them with html2canvas according to your own needs.")])]),e("p",[t._v("After version "),e("code",[t._v("0.6.16+")]),t._v(", third-party libraries such as 'dom-to-image-more' and 'html2canvas' will no longer be used for export, Compatibility and export are no longer issues.")]),e("h2",[t._v("Register")]),e("pre",{staticClass:"hljs"},[e("code",[e("span",{staticClass:"hljs-keyword"},[t._v("import")]),t._v(" MindMap "),e("span",{staticClass:"hljs-keyword"},[t._v("from")]),t._v(" "),e("span",{staticClass:"hljs-string"},[t._v("'simple-mind-map'")]),t._v("\n"),e("span",{staticClass:"hljs-keyword"},[t._v("import")]),t._v(" RichText "),e("span",{staticClass:"hljs-keyword"},[t._v("from")]),t._v(" "),e("span",{staticClass:"hljs-string"},[t._v("'simple-mind-map/src/plugins/RichText.js'")]),t._v("\n"),e("span",{staticClass:"hljs-comment"},[t._v("// import RichText from 'simple-mind-map/src/RichText.js' Use this path for versions below v0.6.0")]),t._v("\n\nMindMap.usePlugin(RichText, opt?)\n")])]),e("p",[t._v("After registration and instantiation of "),e("code",[t._v("MindMap")]),t._v(", the instance can be obtained through "),e("code",[t._v("mindMap.richText")]),t._v(".")]),e("h3",[t._v("Register options")]),e("p",[t._v("The "),e("code",[t._v("opt")]),t._v(" option can pass the following parameters:")]),e("ul",[e("li",[e("code",[t._v("opt.fontFamilyList")])])]),e("p",[t._v("Replace the built-in font list during rich text editing. The built-in list is:")]),e("pre",{staticClass:"hljs"},[e("code",[t._v("[\n "),e("span",{staticClass:"hljs-string"},[t._v("'宋体, SimSun, Songti SC'")]),t._v(",\n "),e("span",{staticClass:"hljs-string"},[t._v("'微软雅黑, Microsoft YaHei'")]),t._v(",\n "),e("span",{staticClass:"hljs-string"},[t._v("'楷体, 楷体_GB2312, SimKai, STKaiti'")]),t._v(",\n "),e("span",{staticClass:"hljs-string"},[t._v("'黑体, SimHei, Heiti SC'")]),t._v(",\n "),e("span",{staticClass:"hljs-string"},[t._v("'隶书, SimLi'")]),t._v(",\n "),e("span",{staticClass:"hljs-string"},[t._v("'andale mono'")]),t._v(",\n "),e("span",{staticClass:"hljs-string"},[t._v("'arial, helvetica, sans-serif'")]),t._v(",\n "),e("span",{staticClass:"hljs-string"},[t._v("'arial black, avant garde'")]),t._v(",\n "),e("span",{staticClass:"hljs-string"},[t._v("'comic sans ms'")]),t._v(",\n "),e("span",{staticClass:"hljs-string"},[t._v("'impact, chicago'")]),t._v(",\n "),e("span",{staticClass:"hljs-string"},[t._v("'times new roman'")]),t._v(",\n "),e("span",{staticClass:"hljs-string"},[t._v("'sans-serif'")]),t._v(",\n "),e("span",{staticClass:"hljs-string"},[t._v("'serif'")]),t._v("\n]\n")])]),e("ul",[e("li",[e("code",[t._v("opt.fontSizeList")])])]),e("p",[t._v("Replace the built-in font size list during rich text editing. The built-in list is:")]),e("pre",{staticClass:"hljs"},[e("code",[t._v("["),e("span",{staticClass:"hljs-number"},[t._v("1")]),t._v(", "),e("span",{staticClass:"hljs-number"},[t._v("2")]),t._v(", "),e("span",{staticClass:"hljs-number"},[t._v("3")]),t._v(", .."),e("span",{staticClass:"hljs-number"},[t._v(".100")]),t._v("]\n")])]),e("h2",[t._v("Method")]),e("h3",[t._v("setNotActiveNodeStyle(node, style)")]),e("blockquote",[e("p",[t._v("v0.8.0+")])]),e("ul",[e("li",[e("code",[t._v("style")]),t._v(":Object, style object.")])]),e("p",[t._v("Set rich text style for inactive nodes.")]),e("h3",[t._v("selectAll()")]),e("p",[t._v("Select All. When the node is being edited, you can select all the text in the node through this method.")]),e("h3",[t._v("focus()")]),e("blockquote",[e("p",[t._v("v0.4.7+")])]),e("p",[t._v("Focus.")]),e("h3",[t._v("formatText(config = {})")]),e("ul",[e("li",[e("code",[t._v("config")]),t._v(":Object. The key is the style attribute and the value is the style value. The complete configuration is as follows:")])]),e("pre",{staticClass:"hljs"},[e("code",[t._v("{\n "),e("span",{staticClass:"hljs-attr"},[t._v("font")]),t._v(": "),e("span",{staticClass:"hljs-string"},[t._v("'字体'")]),t._v(",\n "),e("span",{staticClass:"hljs-attr"},[t._v("size")]),t._v(": "),e("span",{staticClass:"hljs-string"},[t._v("'12px,'")]),t._v(" "),e("span",{staticClass:"hljs-comment"},[t._v("// font size")]),t._v("\n "),e("span",{staticClass:"hljs-attr"},[t._v("bold")]),t._v(": "),e("span",{staticClass:"hljs-literal"},[t._v("true")]),t._v(", "),e("span",{staticClass:"hljs-comment"},[t._v("// Bold or not, true/false ")]),t._v("\n "),e("span",{staticClass:"hljs-attr"},[t._v("italic")]),t._v(": "),e("span",{staticClass:"hljs-literal"},[t._v("true")]),t._v(", "),e("span",{staticClass:"hljs-comment"},[t._v("// Italic or not, true/false ")]),t._v("\n "),e("span",{staticClass:"hljs-attr"},[t._v("underline")]),t._v(": "),e("span",{staticClass:"hljs-literal"},[t._v("true")]),t._v(", "),e("span",{staticClass:"hljs-comment"},[t._v("// Show underline or not, true/false ")]),t._v("\n "),e("span",{staticClass:"hljs-attr"},[t._v("strike")]),t._v(": "),e("span",{staticClass:"hljs-literal"},[t._v("true")]),t._v(", "),e("span",{staticClass:"hljs-comment"},[t._v("// Whether to display strikethrough, true/false ")]),t._v("\n "),e("span",{staticClass:"hljs-attr"},[t._v("color")]),t._v(": "),e("span",{staticClass:"hljs-string"},[t._v("'#333'")]),t._v(" "),e("span",{staticClass:"hljs-comment"},[t._v("// color")]),t._v("\n}\n")])]),e("p",[t._v("Formats the currently selected text.")]),e("h3",[t._v("formatRangeText(range, config = {})")]),e("ul",[e("li",[e("code",[t._v("range")]),t._v(":The range object of "),e("code",[t._v("Quill")]),t._v(", has the following format:")])]),e("pre",{staticClass:"hljs"},[e("code",[t._v("{\n index,\n length\n}\n")])]),e("ul",[e("li",[e("code",[t._v("config")]),t._v(":Same as "),e("code",[t._v("formatText")]),t._v(" method")])]),e("p",[t._v("Formats the text of the specified range.")]),e("h3",[t._v("formatAllText(config = {})")]),e("ul",[e("li",[e("code",[t._v("config")]),t._v(":Same as "),e("code",[t._v("formatText")]),t._v(" method")])]),e("p",[t._v("Formats all text of the current edit node.")]),e("h3",[t._v("removeFormat()")]),e("blockquote",[e("p",[t._v("v0.4.1+")])]),e("p",[t._v("Clears the style of the currently selected text.")]),e("h3",[t._v("normalStyleToRichTextStyle(style)")]),e("p",[t._v("Converts a normal node style object to a rich text style object. Because there are differences between node style attributes and rich text style attributes during non-rich text editing, a conversion operation is required. For example:")]),e("pre",{staticClass:"hljs"},[e("code",[t._v("{\n "),e("span",{staticClass:"hljs-attr"},[t._v("fontFamily")]),t._v(": "),e("span",{staticClass:"hljs-string"},[t._v("'xxx'")]),t._v("\n}\n\n"),e("span",{staticClass:"hljs-comment"},[t._v("// After conversion")]),t._v("\n\n{\n "),e("span",{staticClass:"hljs-attr"},[t._v("font")]),t._v(": "),e("span",{staticClass:"hljs-string"},[t._v("'xxx'")]),t._v("\n}\n")])]),e("h3",[t._v("richTextStyleToNormalStyle(config)")]),e("p",[t._v("Converts rich text style objects to normal node style objects. For example:")]),e("pre",{staticClass:"hljs"},[e("code",[t._v("{\n "),e("span",{staticClass:"hljs-attr"},[t._v("size")]),t._v(": "),e("span",{staticClass:"hljs-string"},[t._v("'16px'")]),t._v("\n}\n\n"),e("span",{staticClass:"hljs-comment"},[t._v("// After conversion")]),t._v("\n\n{\n "),e("span",{staticClass:"hljs-attr"},[t._v("fontSize")]),t._v(": "),e("span",{staticClass:"hljs-number"},[t._v("16")]),t._v("\n}\n")])]),e("h3",[t._v("handleSvgDomElements(svg)")]),e("ul",[e("li",[e("code",[t._v("svg")]),t._v(": "),e("code",[t._v("svg")]),t._v(" node")])]),e("p",[t._v("Convert the "),e("code",[t._v("dom")]),t._v(" element embedded in the "),e("code",[t._v("svg")]),t._v(" into a picture and return a "),e("code",[t._v("Promise")]),t._v(".")]),e("h3",[t._v("transformAllNodesToNormalNode()")]),e("p",[t._v("Convert all nodes to non-rich text nodes.")])])}],o={},i=o,l=s("2877"),v=Object(l["a"])(i,a,n,!1,null,null,null);e["default"]=v.exports}}]); \ No newline at end of file diff --git a/dist/js/chunk-2d0c226c.js b/dist/js/chunk-2d0c226c.js new file mode 100644 index 000000000..99ecb76ec --- /dev/null +++ b/dist/js/chunk-2d0c226c.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c226c"],{"48a3":function(s,n,t){"use strict";t.r(n);var i=function(){var s=this;s._self._c;return s._m(0)},a=[function(){var s=this,n=s._self._c;return n("div",[n("h1",[s._v("NodeImgAdjust plugin")]),n("blockquote",[n("p",[s._v("v0.6.5+")])]),n("p",[s._v("This plugin provides the function of dragging and adjusting the size of images within nodes.")]),n("h2",[s._v("Register")]),n("pre",{staticClass:"hljs"},[n("code",[n("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" MindMap "),n("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),n("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map'")]),s._v("\n"),n("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" NodeImgAdjust "),n("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),n("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map/src/plugins/NodeImgAdjust.js'")]),s._v("\n\nMindMap.usePlugin(NodeImgAdjust)\n")])]),n("p",[s._v("After registration and instantiation of "),n("code",[s._v("MindMap")]),s._v(", the instance can be obtained through "),n("code",[s._v("mindMap.nodeImgAdjust")]),s._v(".")])])}],e={},o=e,d=t("2877"),l=Object(d["a"])(o,i,a,!1,null,null,null);n["default"]=l.exports}}]); \ No newline at end of file diff --git a/dist/js/chunk-2d0c4a65.js b/dist/js/chunk-2d0c4a65.js new file mode 100644 index 000000000..273c301a2 --- /dev/null +++ b/dist/js/chunk-2d0c4a65.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c4a65"],{"3c76":function(s,a,t){"use strict";t.r(a);var n=function(){var s=this;s._self._c;return s._m(0)},v=[function(){var s=this,a=s._self._c;return a("div",[a("h1",[s._v("设置基础样式")]),a("p",[s._v("基础样式修改的其实是主题配置,所以会通过"),a("code",[s._v("setThemeConfig")]),s._v("方法设置。")]),a("h2",[s._v("设置背景")]),a("p",[s._v("画布背景可以设置颜色或图片。")]),a("h3",[s._v("设置画布背景颜色")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.setThemeConfig({\n "),a("span",{staticClass:"hljs-attr"},[s._v("backgroundColor")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'#A4DD00'")]),s._v("\n})\n")])]),a("h3",[s._v("设置背景图片")]),a("p",[s._v("背景图片还支持设置三个属性:"),a("code",[s._v("图片重复")]),s._v("、"),a("code",[s._v("图片位置")]),s._v("、"),a("code",[s._v("图片大小")]),s._v("。其实就是"),a("code",[s._v("css")]),s._v("的"),a("code",[s._v("background-repeat")]),s._v("、"),a("code",[s._v("background-position")]),s._v("、"),a("code",[s._v("background-size")]),s._v("三个属性。")]),a("p",[s._v("不过导出为图片的时候背景图片的行为和"),a("code",[s._v("css")]),s._v("并不完全一致,因为导出是通过"),a("code",[s._v("canvas")]),s._v("实现的,而"),a("code",[s._v("canvas")]),s._v("并不存在这三个属性,所以是通过有限模拟"),a("code",[s._v("css")]),s._v("这三个属性行为实现的,详情可以阅读文章"),a("a",{attrs:{href:"https://juejin.cn/post/7204854015463538744"}},[s._v("如何在canvas中模拟css的背景图片样式")]),s._v("。")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.setThemeConfig({\n "),a("span",{staticClass:"hljs-attr"},[s._v("backgroundImage")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'xxx.png'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("backgroundRepeat")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'no-repeat'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("backgroundPosition")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'center center'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("backgroundSize")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'cover'")]),s._v("\n})\n")])]),a("p",[a("code",[s._v("backgroundRepeat")]),s._v("支持设置的值如下:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("[\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'不重复'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'no-repeat'")]),s._v("\n },\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'重复'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'repeat'")]),s._v("\n },\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'水平方向重复'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'repeat-x'")]),s._v("\n },\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'垂直方向重复'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'repeat-y'")]),s._v("\n }\n]\n")])]),a("p",[a("code",[s._v("backgroundPosition")]),s._v("支持设置的值如下:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("[\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'默认'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'0% 0%'")]),s._v("\n },\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'左上'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'left top'")]),s._v("\n },\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'左中'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'left center'")]),s._v("\n },\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'左下'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'left bottom'")]),s._v("\n },\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'右上'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'right top'")]),s._v("\n },\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'右中'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'right center'")]),s._v("\n },\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'右下'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'right bottom'")]),s._v("\n },\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'中上'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'center top'")]),s._v("\n },\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'居中'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'center center'")]),s._v("\n },\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'中下'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'center bottom'")]),s._v("\n }\n]\n")])]),a("p",[a("code",[s._v("backgroundSize")]),s._v("支持设置的值如下:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("[\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'自动'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'auto'")]),s._v("\n },\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'覆盖'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'cover'")]),s._v("\n },\n {\n "),a("span",{staticClass:"hljs-attr"},[s._v("name")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'保持'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("value")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'contain'")]),s._v("\n }\n]\n")])]),a("h2",[s._v("设置连线样式")]),a("p",[s._v("设置节点间的连线样式,支持:"),a("code",[s._v("颜色")]),s._v("、"),a("code",[s._v("粗细")]),s._v("、"),a("code",[s._v("虚线")]),s._v("、"),a("code",[s._v("风格")]),s._v("。")]),a("p",[s._v("目前支持三种连线风格,分别是:曲线(curve)、直线(straight)、直连(direct),其中曲线只在"),a("code",[s._v("logicalStructure")]),s._v("逻辑结构图和"),a("code",[s._v("mindMap")]),s._v("思维导图两种结构时生效。")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.setThemeConfig({\n "),a("span",{staticClass:"hljs-attr"},[s._v("lineColor")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'#009CE0'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("lineWidth")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("3")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("lineDasharray")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'15, 10, 5, 10, 15'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("lineStyle")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'curve'")]),s._v("\n})\n")])]),a("h2",[s._v("设置概要的连线样式")]),a("p",[s._v("概要节点前面会有一条弧线,它的颜色和粗细可以修改。")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.setThemeConfig({\n "),a("span",{staticClass:"hljs-attr"},[s._v("generalizationLineColor")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'#FA28FF'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("generalizationLineWidth")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("4")]),s._v("\n})\n")])]),a("h2",[s._v("设置关联线的样式")]),a("blockquote",[a("p",[s._v("关联线需要使用关联线插件")])]),a("p",[s._v("关联线支持设置颜色和粗细,因为它还可以被激活选中,所以还可以设置激活时的颜色和粗细。")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.setThemeConfig({\n "),a("span",{staticClass:"hljs-attr"},[s._v("associativeLineColor")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'#FA28FF'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("associativeLineWidth")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("4")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("associativeLineActiveColor")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'#9F0500'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("associativeLineActiveWidth")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("6")]),s._v("\n})\n")])]),a("h2",[s._v("设置节点边框风格")]),a("p",[s._v("默认节点的边框时封闭图形,不过也提供了一种只有底边边框的风格。")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.setThemeConfig({\n "),a("span",{staticClass:"hljs-attr"},[s._v("nodeUseLineStyle")]),s._v(": "),a("span",{staticClass:"hljs-literal"},[s._v("true")]),s._v("\n})\n")])]),a("h2",[s._v("设置节点内边距")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.setThemeConfig({\n "),a("span",{staticClass:"hljs-attr"},[s._v("paddingX")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("30")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("paddingY")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("20")]),s._v("\n})\n")])]),a("h2",[s._v("设置节点内的图片最大的显示宽高")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.setThemeConfig({\n "),a("span",{staticClass:"hljs-attr"},[s._v("imgMaxWidth")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("100")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("imgMaxHeight")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("50")]),s._v("\n})\n")])]),a("h2",[s._v("设置节点内图标的显示大小")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.setThemeConfig({\n "),a("span",{staticClass:"hljs-attr"},[s._v("iconSize")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("30")]),s._v(",\n})\n")])]),a("h2",[s._v("设置节点外边距")]),a("p",[s._v("设置节点外边距稍微麻烦一点,需要针对不同层级的节点进行设置。")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.setThemeConfig({\n "),a("span",{staticClass:"hljs-comment"},[s._v("// 二级节点样式")]),s._v("\n "),a("span",{staticClass:"hljs-attr"},[s._v("second")]),s._v(": {\n "),a("span",{staticClass:"hljs-attr"},[s._v("marginX")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("30")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("marginY")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("20")]),s._v("\n },\n "),a("span",{staticClass:"hljs-comment"},[s._v("// 三级及以下节点样式")]),s._v("\n "),a("span",{staticClass:"hljs-attr"},[s._v("node")]),s._v(": {\n "),a("span",{staticClass:"hljs-attr"},[s._v("marginX")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("40")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("marginY")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("30")]),s._v("\n }\n})\n")])]),a("h2",[s._v("完整示例")]),a("iframe",{staticStyle:{width:"100%",height:"455px",border:"none"},attrs:{src:"https://wanglin2.github.io/playground/#eNq1WAtvE0cQ/iurQ8hOsc92EofgJoiQEIpEWgRUEOUidL5b2xfOt+ZunThEkYCWR3iUVqUtLbRKaQpIraBqq0ISkvyZ+JF/0dm9p31OsKM2UuS7nZlvvp3dnZ25BWGkVBJny1jICEOWYmoliixMy6WjkqEVS8SkaAGZOBdDxJggZYNiNYasgqzrZO4szqFFlDNJEUUAIeJZTGiGOiGXbJEkWDCs43gRRuNFuSQJkoGQZOiYIjbGNIeRUdZ1yZCMRAJVN76uLj2obV2r/b1e/+Hzxt0b9Rur1TvfNX5+KRkKMSyKZIVqs/hjomILbH0+0anpHgel8WqzvvGq8dn92vevd549bSz96RrD/I7nR4lOTLCN9qDho2iBUXLIiCA/X8BFPEqMnJaPchlCWVm5nDchBCo3zaDIgZH+sbFkEuYt0UVwu9jseeun+tpWbflN9d3DJs+ninIe788zNwXPBUpLViaR0CtXDGveEollxRUjnsXajGbkRVnX5suGYokKKSZkC1CtRC+eHEwPjqSKRJwp4Xwk1op9FpewTAHcIHGTP4d1zhBLoxoxQEvBsBdMZP+ENc9pVxlRhcyCtKsAndYMfI7O612FSAcjb1mSySOjJ5IuJya6oKm0kEF9gaExGXaNacrzYJFKx1AqGUPOTyrNbJspV+/crj14ZlPe+eWL2vI7ewMrZdMjfMpQcQVYJ20R88LHT2sws2E0FQHlWRyJoYhFTVnLFyDCKKJqJlZoZNoLwZxGlcK+o8CNMs3Op6IhmocO9aCDqA+8IhRemtrzG43n19nZa7dGnOBJeV8U89jAJuzPqzLbRwzCW7bxkd7B8XF32cKKziL2t99N1Zt/Na4/ArLAuh3fEWtffOH0EEUDDrMQyV3Jtmi5TNtLR3ju8pCOjCfTkET20nXwBlpnvr2xVX/0srr2TWNz1d2U9pzLFk+O+5qyAYafWr5tBlGzjHc5w3ZuvnUTGDTe/Bg4xsz9GVlVIR9147xkm1yEw5p0QuIMTWZQL5ysPVnA2lefbNaXbteeXquuvGBb4fFmfWWt+mpj57fHLex4MmV5qht+WjE/IVecBUm7FO3RjzA702z4PTSBY235ts9u5UX1j2AK5OzgrWtyjo0TvD04rHzbdsEmZDOvGd24ZLtw7X597YUN7J48JrIwYKsZG8X+K3L84OL6o876soFFR8jA3y4BePXh3e31X7ff3gt7Ybu1vY/+tj76XB9N8fGKm2h45qw4wXNuUeNOHOsZpBKlXIQLUMxjekKH2Bj0+PwpNRpxLCFUVIZjZEZ6HCqqTOUAW0lgA5KQCfCXBIorFMYkoba8ak9YErypuLFhikpB01UTG6A85QMEsNp7aPESXL+AI1evORGHkZoZ84sjhOKTDr/tNo3QVPaaTguN6p1btUevt9+u7zx7HCJj67KzArpwK5dMjZganb+UikyHVJu5hvnyC3R39f9xAi03xXnY4FDn8RgKAwNKti8n4/jhVB+O9/cmU/Fsr9wXHxzoT6bUgb5cNj0oCeHZ7orLdrJJ9E9yOVZMMidTC5JQgYd4bzomCfPwlFyMOWOBoemWAHUf0eBrQBaE+Y93vKZyrc6CGLZm1wrbWZLQTZl+Ra8kKoXekYuXj1cmi+mZkzidGzs8dmHSHE1nxZKR380VS/jMXZutNseuKSZLJYO50BUX+H3lyAMJiEJi7PjABpfEfXTGXDPN0OhZQuySwOsgpiI6zvEK2OkhnFr0Q7s75Nm//uSr6pe/O0mf94Pba/e21/8J3kvEiELLouJLdk8IgFH2GuM3A6t+/YQO5ZXfN4qzsl5m16ur55XC8D+UsHth6ILhhWJoYGWK4Q2hIVWbRYoOx2RYEhwSY7hIJIGLHQVN9aXeNQAqQwmQBhVdJEqInpWZii2U6FC2TCkx0DFF15TLoOL3raAVbm+HEraBAwD4bQF42dMCYBdNHQF4ZaEPEegROoBobm8AJdxadYoS6EE8Nm1bl04BA02CBxhuLN6P1lp+A1i4Vu8o3IEy2g94c9HdMY5X8LYi8dW3a+TOwZxaM4wFpW2XWHbZ2Yrk1qgtMP4Jcp+GEoEDCq8WCznXOOZ8kJIEMWF/hXKqOBFbRVGx4Cbz0o0YOMtuuuAJlKfHg1wPmhEvf5kYPEIy4QKe+tj/gdYz70L5hnLWInqZ2obQtEMWzKCk80ZJyX8Ju7dTNqttk6WK67m93w9cz3bp66M6/ZQ74FEXnRTUIeOUy8Ah7b0DIKRPvgZCDO4otgLsu584YxEDPjNyeHZ5MQGrJVyHkgBfEe2bU0zAo2hCSa4VMVuseNYkcxY2AcS7CNt8WbRtw0vNrBxui8Liv2HIkPI="}})])}],l={},_=l,i=t("2877"),e=Object(i["a"])(_,n,v,!1,null,null,null);a["default"]=e.exports}}]); \ No newline at end of file diff --git a/dist/js/chunk-2d0c53b9.js b/dist/js/chunk-2d0c53b9.js new file mode 100644 index 000000000..5db26828f --- /dev/null +++ b/dist/js/chunk-2d0c53b9.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c53b9"],{"3de7":function(n,e,v){"use strict";v.r(e);var _=function(){var n=this;n._self._c;return n._m(0)},c=[function(){var n=this,e=n._self._c;return e("div",[e("h1",[n._v("打开预览在线文件")]),e("p",[n._v("v0.7.0+版本支持打开url中携带的在线文件:")]),e("pre",{staticClass:"hljs"},[e("code",[n._v("https://wanglin2.github.io/mind-map/#/?fileURL=http://xxx.com/xxx.xmind\n")])]),e("p",[n._v("在"),e("code",[n._v("fileURL")]),n._v("参数后带上你的在线文件url即可,目前支持"),e("code",[n._v(".xmind")]),n._v("、"),e("code",[n._v(".smm")]),n._v("、"),e("code",[n._v(".json")]),n._v("、"),e("code",[n._v(".md")]),n._v("后缀的文件url。")]),e("p",[n._v("需要注意的是你在打开在线文件的情况下编辑并不会修改在线文件,改动会保存在你的浏览器本地,你可以选择导出文件。")])])}],t={},i=t,l=v("2877"),o=Object(l["a"])(i,_,c,!1,null,null,null);e["default"]=o.exports}}]); \ No newline at end of file diff --git a/dist/js/chunk-2d0c53e8.js b/dist/js/chunk-2d0c53e8.js new file mode 100644 index 000000000..df238bc88 --- /dev/null +++ b/dist/js/chunk-2d0c53e8.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c53e8"],{"3def":function(s,t,a){"use strict";a.r(t);var l=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("Scrollbar 插件")]),t("blockquote",[t("p",[s._v("v0.7.0+")]),t("p",[s._v("v0.7.1+进行了重构,下面的文档为新文档。")])]),t("p",[s._v("该插件用于帮助开发水平和垂直滚动条的功能。详细使用方式请参考教程。")]),t("h2",[s._v("注册")]),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(" Scrollbar "),t("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),t("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map/src/plugins/Scrollbar.js'")]),s._v("\nMindMap.usePlugin(Scrollbar)\n")])]),t("p",[s._v("注册完且实例化"),t("code",[s._v("MindMap")]),s._v("后可通过"),t("code",[s._v("mindMap.scrollbar")]),s._v("获取到该实例。")]),t("h2",[s._v("事件")]),t("h4",[s._v("scrollbar_change(data)")]),t("ul",[t("li",[t("code",[s._v("data")]),s._v(":滚动条数据,格式如下:")])]),t("pre",{staticClass:"hljs"},[t("code",[s._v("{\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 垂直滚动条")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("vertical")]),s._v(": {\n top,"),t("span",{staticClass:"hljs-comment"},[s._v("// 垂直滚动条的top值,百分比数值")]),s._v("\n height"),t("span",{staticClass:"hljs-comment"},[s._v("// 垂直滚动条的高度,百分比数值")]),s._v("\n },\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 水平滚动条")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("horizontal")]),s._v(": {\n left,"),t("span",{staticClass:"hljs-comment"},[s._v("// 水平滚动条的left值,百分比数值")]),s._v("\n width"),t("span",{staticClass:"hljs-comment"},[s._v("// 水平滚动条的宽度,百分比数值")]),s._v("\n }\n}\n")])]),t("p",[s._v("当滚动条数据发生改变时触发,你可以监听该事件来更新滚动条位置和大小。接收一个参数,代表当前最新的滚动条位置和大小信息,你可以使用它来更新滚动条元素的样式。")]),t("h2",[s._v("方法")]),t("h3",[s._v("setScrollBarWrapSize(width, height)")]),t("ul",[t("li",[t("p",[t("code",[s._v("width")]),s._v(":Number,你的滚动条容器元素的宽度。")])]),t("li",[t("p",[t("code",[s._v("height")]),s._v(": Number,你的滚动条容器元素的高度。")])])]),t("p",[s._v("设置滚动条容器的大小,对于水平滚动条,即容器的宽度,对于垂直滚动条,即容器的高度。当你的滚动条容器尺寸改变时需要再次调用该方法。")]),t("h3",[s._v("calculationScrollbar()")]),t("blockquote",[t("p",[s._v("通常你不需要调用该方法,如果初次渲染滚动条时滚动条没有更新,那么可以手动调用该方法获取滚动条数据。")]),t("p",[s._v("需要先调用setScrollBarWrapSize方法设置滚动条容器元素的宽高。")])]),t("p",[s._v("返回值:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("{\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 垂直滚动条")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("vertical")]),s._v(": {\n top,\n height\n },\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 水平滚动条")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("horizontal")]),s._v(": {\n left,\n width\n }\n}\n")])]),t("p",[s._v("获取滚动条大小和位置。")]),t("h3",[s._v("onMousedown(e, type)")]),t("ul",[t("li",[t("p",[t("code",[s._v("e")]),s._v(":鼠标按下事件的事件对象。")])]),t("li",[t("p",[t("code",[s._v("type")]),s._v(":按下的滚动条类型,vertical(垂直滚动条)、horizontal(水平滚动条)。")])])]),t("p",[s._v("滚动条元素的鼠标按下事件时需要调用该方法。")]),t("h3",[s._v("onClick(e, type)")]),t("ul",[t("li",[t("p",[t("code",[s._v("e")]),s._v(":鼠标点击事件的事件对象。")])]),t("li",[t("p",[t("code",[s._v("type")]),s._v(":鼠标点击的滚动条类型,vertical(垂直滚动条)、horizontal(水平滚动条)。")])])]),t("p",[s._v("滚动条元素的的点击事件时需要调用该方法。")])])}],v={},_=v,c=a("2877"),e=Object(c["a"])(_,l,n,!1,null,null,null);t["default"]=e.exports}}]); \ No newline at end of file diff --git a/dist/js/chunk-2d0c5538.js b/dist/js/chunk-2d0c5538.js new file mode 100644 index 000000000..05844ca1b --- /dev/null +++ b/dist/js/chunk-2d0c5538.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c5538"],{"3f2a":function(s,t,a){"use strict";a.r(t);var n=function(){var s=this;s._self._c;return s._m(0)},l=[function(){var s=this,t=s._self._c;return t("div",[t("h1",[s._v("主题")]),t("h2",[s._v("使用和切换主题")]),t("p",[t("code",[s._v("simple-mind-map")]),s._v("内置了很多主题,可以通过如下方式获取到所有的内置主题列表:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" { themeList } "),t("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),t("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map/src/constants/constant'")]),s._v("\n"),t("span",{staticClass:"hljs-comment"},[s._v("// import { themeList } from 'simple-mind-map/src/utils/constant' v0.6.0以下版本使用该路径")]),s._v("\n")])]),t("blockquote",[t("p",[s._v("v0.6.8+,主题列表增加了代表是否是暗黑主题的字段dark,你可以根据这个字段来将界面切换为暗黑模式。")])]),t("p",[s._v("可以在实例化"),t("code",[s._v("simple-mind-map")]),s._v("时指定使用的主题:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("new")]),s._v(" MindMap({\n "),t("span",{staticClass:"hljs-attr"},[s._v("theme")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'minions'")]),s._v("\n})\n")])]),t("p",[s._v("如果想动态切换主题也很简单:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("mindMap.setTheme("),t("span",{staticClass:"hljs-string"},[s._v("'classic'")]),s._v(")\n")])]),t("p",[s._v("如果要获取当前使用的主题名称可以使用:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("const")]),s._v(" theme = mindMap.getTheme()\n")])]),t("h2",[s._v("定义新主题")]),t("p",[s._v("除了可以使用内置的主题外,你也可以自定义新主题:")]),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\n"),t("span",{staticClass:"hljs-comment"},[s._v("// 注册新主题")]),s._v("\nMindMap.defineTheme("),t("span",{staticClass:"hljs-string"},[s._v("'主题名称'")]),s._v(", {\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 主题配置")]),s._v("\n})\n\n"),t("span",{staticClass:"hljs-comment"},[s._v("// 1.实例化时使用新注册的主题")]),s._v("\n"),t("span",{staticClass:"hljs-keyword"},[s._v("const")]),s._v(" mindMap = "),t("span",{staticClass:"hljs-keyword"},[s._v("new")]),s._v(" MindMap({\n "),t("span",{staticClass:"hljs-attr"},[s._v("theme")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'主题名称'")]),s._v("\n})\n\n"),t("span",{staticClass:"hljs-comment"},[s._v("// 2.动态切换新主题")]),s._v("\nmindMap.setTheme("),t("span",{staticClass:"hljs-string"},[s._v("'主题名称'")]),s._v(")\n")])]),t("p",[s._v("最好在实例化之前进行注册,这样在实例化时可以直接使用新注册的主题。")]),t("p",[s._v("一个主题其实就是一个普通的对象,完整配置可以参考"),t("a",{attrs:{href:"https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/themes/default.js"}},[s._v("默认主题")]),s._v(","),t("code",[s._v("defineTheme")]),s._v("方法会把你传入的配置和默认配置做合并。大部分主题其实需要自定义的部分不是很多,一个典型的自定义主题配置可以参考"),t("a",{attrs:{href:"https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/themes/blueSky.js"}},[s._v("blueSky")]),s._v("。")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("MindMap.defineTheme("),t("span",{staticClass:"hljs-string"},[s._v("'redSpirit'")]),s._v(", {\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 背景颜色")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("backgroundColor")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(255, 238, 228)'")]),s._v(",\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 连线的颜色")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("lineColor")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(230, 138, 131)'")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("lineWidth")]),s._v(": "),t("span",{staticClass:"hljs-number"},[s._v("3")]),s._v(",\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 概要连线的粗细")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("generalizationLineWidth")]),s._v(": "),t("span",{staticClass:"hljs-number"},[s._v("3")]),s._v(",\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 概要连线的颜色")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("generalizationLineColor")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(222, 101, 85)'")]),s._v(",\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 根节点样式")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("root")]),s._v(": {\n "),t("span",{staticClass:"hljs-attr"},[s._v("fillColor")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(207, 44, 44)'")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("color")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(255, 233, 157)'")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("borderColor")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("''")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("borderWidth")]),s._v(": "),t("span",{staticClass:"hljs-number"},[s._v("0")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("fontSize")]),s._v(": "),t("span",{staticClass:"hljs-number"},[s._v("24")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("active")]),s._v(": {\n "),t("span",{staticClass:"hljs-attr"},[s._v("borderColor")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(255, 233, 157)'")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("borderWidth")]),s._v(": "),t("span",{staticClass:"hljs-number"},[s._v("3")]),s._v(",\n }\n },\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 二级节点样式")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("second")]),s._v(": {\n "),t("span",{staticClass:"hljs-attr"},[s._v("fillColor")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(255, 255, 255)'")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("color")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(211, 58, 21)'")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("borderColor")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(222, 101, 85)'")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("borderWidth")]),s._v(": "),t("span",{staticClass:"hljs-number"},[s._v("2")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("fontSize")]),s._v(": "),t("span",{staticClass:"hljs-number"},[s._v("18")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("active")]),s._v(": {\n "),t("span",{staticClass:"hljs-attr"},[s._v("borderColor")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(255, 233, 157)'")]),s._v(",\n }\n },\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 三级及以下节点样式")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("node")]),s._v(": {\n "),t("span",{staticClass:"hljs-attr"},[s._v("fontSize")]),s._v(": "),t("span",{staticClass:"hljs-number"},[s._v("14")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("color")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(144, 71, 43)'")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("active")]),s._v(": {\n "),t("span",{staticClass:"hljs-attr"},[s._v("borderColor")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(255, 233, 157)'")]),s._v("\n }\n },\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 概要节点样式")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("generalization")]),s._v(": {\n "),t("span",{staticClass:"hljs-attr"},[s._v("fontSize")]),s._v(": "),t("span",{staticClass:"hljs-number"},[s._v("14")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("fillColor")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(255, 247, 211)'")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("borderColor")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(255, 202, 162)'")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("borderWidth")]),s._v(": "),t("span",{staticClass:"hljs-number"},[s._v("2")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("color")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(187, 101, 69)'")]),s._v(",\n "),t("span",{staticClass:"hljs-attr"},[s._v("active")]),s._v(": {\n "),t("span",{staticClass:"hljs-attr"},[s._v("borderColor")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'rgb(222, 101, 85)'")]),s._v("\n }\n }\n})\n")])]),t("h2",[s._v("完整示例")]),t("iframe",{staticStyle:{width:"100%",height:"455px",border:"none"},attrs:{src:"https://wanglin2.github.io/playground/#eNrFV+tvG0UQ/1dWh9A5yDk/0wTjVIXCB6QGoRaJD7kIne/W9rbn3eN2nUcjSxBQadpUBYEoL6ESiZIPSKCCSh5U+Wf8SP8LZm/vZfuSlqpSP/ixszO/mf3N7Nzcpvam5xmrXazVtDq3feIJxLHoeudNSjoe8wXaRD5u5hGjS6xLBXbyiLct12Vrl3ET9VDTZx2kA4IeWywR6ixZntoyNQ5iF892QDrbsTxTMylCJnWxQFImNRcR7bqukhcKaPD468H2neHxJ8O/j0Y/fH5ya2u0dTC4ee/klz2T2oxygSxbkFX8HnMwB+skotzyyoxJFcrNL4Z3dvv7R092v4vM7LZFW/iDNu5gMMvNoMXzaFP6DSMx4PDBbk63XYtzYusA1wsRh3/tDW7sDA4e9R8fj77ZG3775zi6g5uEZqGHjBgphZzuY+eKR3wi9LzSQgh8nHy2M/z+jye7P51sP1TChmVfa/lAvnORucyvId1vNXLlubk8KlcW4Ku8MKPnE4Djn0eHx0BbGsMFt2PWlWIelaR1qVKKraXWh8QR7RqqJIDDB1snDz6NYUcP742ObqjdFqbYt1xy3RKE0UvPYp6Oatp8LMZyGcIrlvJoYS59wOH9A1URw/v/DP69q+Q+Y6IW0YhQk7juGFZxPo+qVfmJoRCyp/msgMu5+ZROg/kO9iOsSXl43GIsbjIqrpDruIbK1VioijUV3iTsWQFMuIqYRQiqMvhJmOkf7owOf5smh2OoT+csegLf4ddpBJUgE3Oy3pKCyTxHVtomDlHO4Ku08GL4yqBlfxtoGdy91T/6tb9/e5ofCm0kzU4SU5LDNBUlWUnzcMJqJeX4eaI+Pejw2kzFOn5nnhZ1dqKrcBkgnWenMdAsylyeKz89j2P0LAB+UAHnXv/f/IxVzyQ90IdFDxpyVr9O2mnUseNHVm660ctHDl6LGnMujAm7NeQwu9vBVBgtLN5xAZqKtzbedXJ6aHkReLagVfn6THg0xxJW6limJgWmNnZSKRZ4XUixqcUtTD0M06mXinabuI6PqVReTjAm4DK9THpKt4TE2bjDDKcryV5a7yVFEP0NZZEdoURchr4vp4D3GSfqQizrLm7KZ6puQ+ogTSuhupB1AmUGeQRFHhRXb+YNNXUEd27041eDL38P71wwffQPb/ePHqULjtGcLvvFR6qcwU9OLvNBE7lEuEhKLSr5YEoxVi23K8eCSE+5h1KFT72gZi+YumAhMAxMlsCwQqjukFUUzCKLphYG8TbuMFMLtkMF4iS7cYGCSr0Au2nFCEkw5jYsqaI2TVFvdIVgFF2wXWJfA5XUrARq6WmqXlC6oS1AT9qmBh2wPW1umsBJgo3+1QspLmDJxYaraLkQzpqmZhTUgBnNWJh3DJtzU4sza6RoizKzphpYqVh8NdBDyIsryMfgEfIWbATFJz+vTNIbQSWGVoMztyuUIYxTUIcwG4QrwbxkMe2+jUmrDerVYtFbjzxn+30t8tyx/BYBvxGqZzkOoa1IEIduhNl+xohLUQRh0PEaAKFSgxxoeU1lQI70xlXOKLxBBPBmuAEZiDuDqcELgmoHRgH+Gj70ZdLBMlmzDZ+tcewDiKmFVzXjpUHatoXweK1QcNc/pnyDG4zzWZvONjC5Csc24Km40aU2N2zWKUCZY8EzakO6CQ/T03r/AbfdVt0="}})])}],v={},i=v,_=a("2877"),r=Object(_["a"])(i,n,l,!1,null,null,null);t["default"]=r.exports}}]); \ No newline at end of file diff --git a/dist/js/chunk-2d0d2ec3.js b/dist/js/chunk-2d0d2ec3.js new file mode 100644 index 000000000..1fcbff3e2 --- /dev/null +++ b/dist/js/chunk-2d0d2ec3.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d2ec3"],{"5b22":function(s,n,a){"use strict";a.r(n);var t=function(){var s=this;s._self._c;return s._m(0)},i=[function(){var s=this,n=s._self._c;return n("div",[n("h1",[s._v("Painter 插件")]),n("blockquote",[n("p",[s._v("v0.6.12+")])]),n("p",[s._v("节点格式刷插件。")]),n("h2",[s._v("注册")]),n("pre",{staticClass:"hljs"},[n("code",[n("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" MindMap "),n("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),n("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map'")]),s._v("\n"),n("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" Painter "),n("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),n("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map/src/plugins/Painter.js'")]),s._v("\nMindMap.usePlugin(Painter)\n")])]),n("p",[s._v("注册完且实例化"),n("code",[s._v("MindMap")]),s._v("后可通过"),n("code",[s._v("mindMap.painter")]),s._v("获取到该实例。")]),n("h2",[s._v("事件")]),n("blockquote",[n("p",[s._v("可以通过mindMap.on('事件名称', () => {})来监听事件。")])]),n("h3",[s._v("painter_start")]),n("p",[s._v("开始格式刷事件。")]),n("h3",[s._v("painter_end")]),n("p",[s._v("结束格式刷事件。")]),n("h2",[s._v("方法")]),n("h3",[s._v("startPainter()")]),n("p",[s._v("开始格式刷。")]),n("p",[s._v("当调用了该方法后,如果当前存在激活节点,那么会默认取第一个激活的节点为指定节点,点击其他节点后,会把该节点的样式应用到被点击的其他节点,当点击画布后本次格式刷操作结束。")])])}],_={},p=_,v=a("2877"),e=Object(v["a"])(p,t,i,!1,null,null,null);n["default"]=e.exports}}]); \ No newline at end of file diff --git a/dist/js/chunk-2d0d5cb9.js b/dist/js/chunk-2d0d5cb9.js new file mode 100644 index 000000000..4cb9b7799 --- /dev/null +++ b/dist/js/chunk-2d0d5cb9.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d5cb9"],{"708b":function(e,i,t){"use strict";t.r(i);var s=function(){var e=this;e._self._c;return e._m(0)},a=[function(){var e=this,i=e._self._c;return i("div",[i("h1",[e._v("AssociativeLine plugin")]),i("blockquote",[i("p",[e._v("v0.4.5+")])]),i("blockquote",[i("p",[e._v("The function of adjusting associated line control points is supported from v0.4.6+")])]),i("blockquote",[i("p",[e._v("Relevance support for text editing starting from v0.5.11+")])]),i("p",[e._v("This plugin is used to support the addition of associative lines.")]),i("h2",[e._v("Register")]),i("pre",{staticClass:"hljs"},[i("code",[i("span",{staticClass:"hljs-keyword"},[e._v("import")]),e._v(" MindMap "),i("span",{staticClass:"hljs-keyword"},[e._v("from")]),e._v(" "),i("span",{staticClass:"hljs-string"},[e._v("'simple-mind-map'")]),e._v("\n"),i("span",{staticClass:"hljs-keyword"},[e._v("import")]),e._v(" AssociativeLine "),i("span",{staticClass:"hljs-keyword"},[e._v("from")]),e._v(" "),i("span",{staticClass:"hljs-string"},[e._v("'simple-mind-map/src/plugins/AssociativeLine.js'")]),e._v("\n"),i("span",{staticClass:"hljs-comment"},[e._v("// import AssociativeLine from 'simple-mind-map/src/AssociativeLine.js' Use this path for versions below v0.6.0")]),e._v("\n\nMindMap.usePlugin(AssociativeLine)\n")])]),i("p",[e._v("After registration and instantiation of "),i("code",[e._v("MindMap")]),e._v(", the instance can be obtained through "),i("code",[e._v("mindMap.associativeLine")]),e._v(".")]),i("h2",[e._v("Config")]),i("p",[e._v("Support for modifying the thickness and color of associated lines, divided into default and active states. The configuration is as follows:")]),i("ul",[i("li",[i("p",[i("code",[e._v("associativeLineWidth")]),e._v(": The thickness of the default state of the associated line. The default value is "),i("code",[e._v("2")])])]),i("li",[i("p",[i("code",[e._v("associativeLineColor")]),e._v(": Color of the default state of associative lines. The default value is "),i("code",[e._v("rgb(51, 51, 51)")])])]),i("li",[i("p",[i("code",[e._v("associativeLineActiveWidth")]),e._v(": The thickness of the active state of the associated line. The default value is "),i("code",[e._v("8")])])]),i("li",[i("p",[i("code",[e._v("associativeLineActiveColor")]),e._v(": The color of the active state of the associated line. The default value is "),i("code",[e._v("rgba(2, 167, 240, 1)")])])])]),i("p",[e._v("The configuration is provided as a theme, so if you want to modify these four properties, you can modify them using the "),i("code",[e._v("mindMap.setThemeConfig(config)")]),e._v(" method.")]),i("h2",[e._v("Props")]),i("h3",[e._v("mindMap.associativeLine.lineList")]),i("p",[e._v("Currently, all connection line data, array types, and each item of the array are also an array:")]),i("pre",{staticClass:"hljs"},[i("code",[e._v("[\n path, "),i("span",{staticClass:"hljs-comment"},[e._v("// Connector node")]),e._v("\n clickPath, "),i("span",{staticClass:"hljs-comment"},[e._v("// Invisible click line node")]),e._v("\n node, "),i("span",{staticClass:"hljs-comment"},[e._v("// Start node")]),e._v("\n toNode "),i("span",{staticClass:"hljs-comment"},[e._v("// Target node")]),e._v("\n]\n")])]),i("h3",[e._v("mindMap.associativeLine.activeLine")]),i("p",[e._v("The currently active connection line and array type are the same as the structure of each item in the "),i("code",[e._v("lineList")]),e._v(" array.")]),i("h2",[e._v("Methods")]),i("h3",[e._v("renderAllLines()")]),i("p",[e._v("Re-render all associated lines.")]),i("h3",[e._v("removeAllLines()")]),i("p",[e._v("Remove all associated lines.")]),i("h3",[e._v("createLineFromActiveNode()")]),i("p",[e._v("Create an associated line from the current active node. If there are multiple active nodes, the default is the first node.")]),i("p",[e._v("After calling this method, an association line will be rendered from the first active node to the current mouse real-time position. When a target node is clicked, it represents completion of creation. An association line will be rendered between the first active node and the clicked node.")]),i("h3",[e._v("createLine(fromNode)")]),i("p",[e._v("Creates an associative line starting at the specified node.")]),i("p",[e._v("After calling this method, an association line will be rendered from the specified node to the current mouse real-time position. When a target node is clicked, it represents completion of creation, and an association line will be rendered between the specified node and the clicked node.")]),i("h3",[e._v("addLine(fromNode, toNode)")]),i("p",[e._v("Add an associative line directly.")]),i("p",[e._v("Calling this method will directly create an association line from the "),i("code",[e._v("fromNode")]),e._v(" to the "),i("code",[e._v("toNode")]),e._v(" node.")]),i("h3",[e._v("removeLine()")]),i("p",[e._v("Deletes the currently active associative line. Clicking on an associated line is considered active.")]),i("h3",[e._v("clearActiveLine()")]),i("p",[e._v("Clears the active state of the currently active association line.")]),i("h3",[e._v("front()")]),i("blockquote",[i("p",[e._v("v0.8.0+")])]),i("p",[e._v("The top-level display of the associated line.")]),i("h3",[e._v("back()")]),i("blockquote",[i("p",[e._v("v0.8.0+")])]),i("p",[e._v("The associated line returns to its original level.")])])}],o={},n=o,c=t("2877"),l=Object(c["a"])(n,s,a,!1,null,null,null);i["default"]=l.exports}}]); \ No newline at end of file diff --git a/dist/js/chunk-2d0d6590.js b/dist/js/chunk-2d0d6590.js new file mode 100644 index 000000000..8852ee1d1 --- /dev/null +++ b/dist/js/chunk-2d0d6590.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d6590"],{"71bb":function(s,t,a){"use strict";a.r(t);var n=function(){var s=this;s._self._c;return s._m(0)},_=[function(){var s=this,t=s._self._c;return t("div",[t("h1",[s._v("部署")]),t("p",[s._v("本项目的"),t("code",[s._v("web")]),s._v("目录下提供了一个基于"),t("code",[s._v("simple-mind-map")]),s._v("库、"),t("code",[s._v("Vue2.x")]),s._v("、"),t("code",[s._v("ElementUI")]),s._v("开发的完整项目,数据默认存储在电脑本地,此外可以操作电脑本地文件,原意是作为一个线上"),t("code",[s._v("demo")]),s._v(",但是也完全可以直接把它当做一个在线版思维导图应用使用,在线地址:"),t("a",{attrs:{href:"https://wanglin2.github.io/mind-map/"}},[s._v("https://wanglin2.github.io/mind-map/")]),s._v("。")]),t("p",[s._v("如果你的网络环境访问"),t("code",[s._v("GitHub")]),s._v("服务很慢,你也可以部署到你的服务器上。")]),t("h2",[s._v("部署到静态文件服务器")]),t("p",[s._v("项目本身不依赖后端,所以完全可以部署到一个静态文件服务器上,可以依次执行如下命令:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("git "),t("span",{staticClass:"hljs-built_in"},[s._v("clone")]),s._v(" https://github.com/wanglin2/mind-map.git\n"),t("span",{staticClass:"hljs-built_in"},[s._v("cd")]),s._v(" mind-map\n"),t("span",{staticClass:"hljs-built_in"},[s._v("cd")]),s._v(" simple-mind-map\nnpm i\nnpm link\n"),t("span",{staticClass:"hljs-built_in"},[s._v("cd")]),s._v(" ..\n"),t("span",{staticClass:"hljs-built_in"},[s._v("cd")]),s._v(" web\nnpm i\nnpm link simple-mind-map\n")])]),t("p",[s._v("然后你可以选择启动本地服务:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("npm run serve\n")])]),t("p",[s._v("也可以直接打包生成构建产物:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("npm run build\n")])]),t("p",[s._v("打包完后的入口页面"),t("code",[s._v("index.html")]),s._v("可以在项目根目录找到,对应的静态资源在根目录下的"),t("code",[s._v("dist")]),s._v("目录,"),t("code",[s._v("html")]),s._v("文件中会通过相对路径访问"),t("code",[s._v("dist")]),s._v("目录的资源,比如"),t("code",[s._v("dist/xxx")]),s._v("。你可以直接把这两个文件或目录上传到你的静态文件服务器,事实上,本项目就是这样部署到"),t("code",[s._v("GitHub Pages")]),s._v("上的。")]),t("p",[s._v("如果你没有代码修改需求的话,直接从本仓库复制这些文件也是可以的。")]),t("p",[s._v("如果你想把"),t("code",[s._v("index.html")]),s._v("也打包进"),t("code",[s._v("dist")]),s._v("目录,可以修改"),t("code",[s._v("web/package.json")]),s._v("文件的"),t("code",[s._v("scripts.build")]),s._v("命令,把"),t("code",[s._v("vue-cli-service build && node ../copy.js")]),s._v("中的"),t("code",[s._v(" && node ../copy.js")]),s._v("删除即可。")]),t("p",[s._v("如果你想修改打包输出的目录,可以修改"),t("code",[s._v("web/vue.config.js")]),s._v("文件的"),t("code",[s._v("outputDir")]),s._v("配置,改成你想要输出的路径即可。")]),t("p",[s._v("如果你想修改"),t("code",[s._v("index.html")]),s._v("文件引用静态资源的路径的话可以修改"),t("code",[s._v("web/vue.config.js")]),s._v("文件的"),t("code",[s._v("publicPath")]),s._v("配置。以及"),t("code",[s._v("web/public/index.html")]),s._v("文件的"),t("code",[s._v("window.externalPublicPath")]),s._v("配置。")]),t("p",[s._v("另外默认使用的是"),t("code",[s._v("hash")]),s._v("路由,也就是路径中会在"),t("code",[s._v("#")]),s._v(",如果你想使用"),t("code",[s._v("history")]),s._v("路由,可以修改"),t("code",[s._v("web/src/router.js")]),s._v("文件,将:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("const")]),s._v(" router = "),t("span",{staticClass:"hljs-keyword"},[s._v("new")]),s._v(" VueRouter({\n routes\n})\n")])]),t("p",[s._v("改成:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("const")]),s._v(" router = "),t("span",{staticClass:"hljs-keyword"},[s._v("new")]),s._v(" VueRouter({\n "),t("span",{staticClass:"hljs-attr"},[s._v("mode")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'history'")]),s._v(",\n routes\n})\n")])]),t("p",[s._v("不过这需要后台支持,因为我们的应用是个单页客户端应用,如果后台没有正确的配置,当用户在浏览器直接访问子路由时会返回404,所以呢你要在服务端增加一个覆盖所有情况的候选资源:如果"),t("code",[s._v("URL")]),s._v("匹配不到任何静态资源,则应该返回同一个"),t("code",[s._v("index.html")]),s._v("页面。")]),t("h2",[s._v("Docker")]),t("blockquote",[t("p",[s._v("非常感谢"),t("a",{attrs:{href:"https://github.com/shuiche-it"}},[s._v("水车")]),s._v(",本小节由他编写,对应的 Docker 包也由他维护。")])]),t("p",[s._v("直接从 Docker hup 中安装:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("docker run -d -p 8081:8080 shuiche/mind-map:latest\n")])]),t("p",[s._v("mind-map在容器中启动了8080端口作为web服务入口,通过docker运行容器时,需要指定本地映射端口,上面案例中,我们通过本地的8081端口映射到容器端口8080。")]),t("p",[s._v("安装完成后,通过 "),t("code",[s._v("docker ps")]),s._v(" 查看容器运行状态。")]),t("p",[s._v("浏览器打开 127.0.0.1:8081 即可使用Web 思维导图功能。")]),t("p",[t("a",{attrs:{href:"https://laosu.gq/2023/09/02/%E5%BC%BA%E5%A4%A7%E7%9A%84%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE%E5%BA%93SimpleMindMap/"}},[s._v("在群晖上以 Docker 方式安装")])]),t("h2",[s._v("对接自己的存储服务")]),t("p",[s._v("应用数据默认存储在浏览器本地,浏览器本地存储容量是比较小的,所以当在思维导图中插入更多图片后很容易触发限制,所以更好的选择是对接你自己的存储服务,这通常有两种方式:")]),t("h3",[s._v("第一种")]),t("p",[s._v("直接clone本仓库代码,然后修改"),t("code",[s._v("web/src/api/index.js")]),s._v("内的相关方法即可实现从你的数据库里获取数据,以及存储到你的数据中。")]),t("h3",[s._v("第二种")]),t("p",[s._v("很多时候,你可能想始终使用本仓库的最新代码,那么第一种方式就不太方便,因为你要手动去合并代码,所以提供了第二种方式。")]),t("p",[s._v("具体操作步骤:")]),t("p",[s._v("1.复制web应用打包后的资源")]),t("p",[s._v("包括:"),t("code",[s._v("dist")]),s._v("目录和"),t("code",[s._v("index.html")]),s._v("文件。")]),t("p",[s._v("2.修改复制后的"),t("code",[s._v("index.html")]),s._v("文件")]),t("p",[s._v("首先在"),t("code",[s._v("head")]),s._v("标签里插入如下代码:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("