mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 22:08:25 +08:00
Demo:不直接引用内部激活节点列表,优化性能
This commit is contained in:
@@ -59,7 +59,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleNodeActive(...args) {
|
||||
this.activeNodes = args[1]
|
||||
this.activeNodes = [...args[1]]
|
||||
if (this.activeNodes.length > 0) {
|
||||
let firstNode = this.activeNodes[0]
|
||||
this.link = firstNode.getData('hyperlink')
|
||||
|
||||
@@ -52,7 +52,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleNodeActive(...args) {
|
||||
this.activeNodes = args[1]
|
||||
this.activeNodes = [...args[1]]
|
||||
if (this.activeNodes.length > 0) {
|
||||
let firstNode = this.activeNodes[0]
|
||||
this.iconList = firstNode.getData('icon') || []
|
||||
|
||||
@@ -92,7 +92,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleNodeActive(...args) {
|
||||
this.activeNodes = args[1]
|
||||
this.activeNodes = [...args[1]]
|
||||
if (this.activeNodes.length > 0) {
|
||||
let firstNode = this.activeNodes[0]
|
||||
this.nodeImage = firstNode.getData('image')
|
||||
|
||||
@@ -68,7 +68,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleNodeActive(...args) {
|
||||
this.activeNodes = args[1]
|
||||
this.activeNodes = [...args[1]]
|
||||
},
|
||||
|
||||
handleShowNodeImage() {
|
||||
|
||||
@@ -52,7 +52,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleNodeActive(...args) {
|
||||
this.activeNodes = args[1]
|
||||
this.activeNodes = [...args[1]]
|
||||
if (this.activeNodes.length > 0) {
|
||||
let firstNode = this.activeNodes[0]
|
||||
this.note = firstNode.getData('note')
|
||||
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleNodeActive(...args) {
|
||||
this.activeNodes = args[1]
|
||||
this.activeNodes = [...args[1]]
|
||||
if (this.activeNodes.length > 0) {
|
||||
let firstNode = this.activeNodes[0]
|
||||
this.tagArr = firstNode.getData('tag') || []
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
:class="{ isDark: isDark }"
|
||||
v-if="activeNodes.length > 0"
|
||||
>
|
||||
<div class="sidebarContent" v-if="activeNodes.length > 0">
|
||||
<div class="sidebarContent">
|
||||
<!-- 文字 -->
|
||||
<div class="title noTop">{{ $t('style.text') }}</div>
|
||||
<div class="row">
|
||||
@@ -486,7 +486,7 @@ export default {
|
||||
*/
|
||||
onNodeActive(...args) {
|
||||
this.$nextTick(() => {
|
||||
this.activeNodes = args[1]
|
||||
this.activeNodes = [...args[1]]
|
||||
this.initNodeStyle()
|
||||
})
|
||||
},
|
||||
|
||||
@@ -274,7 +274,7 @@ export default {
|
||||
* @Desc: 监听节点激活
|
||||
*/
|
||||
onNodeActive(...args) {
|
||||
this.activeNodes = args[1]
|
||||
this.activeNodes = [...args[1]]
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user