Demo:不直接引用内部激活节点列表,优化性能

This commit is contained in:
wanglin2
2023-09-01 09:36:39 +08:00
parent 6b4c118a2b
commit a404a71ba2
8 changed files with 9 additions and 9 deletions

View File

@@ -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')

View File

@@ -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') || []

View File

@@ -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')

View File

@@ -68,7 +68,7 @@ export default {
},
methods: {
handleNodeActive(...args) {
this.activeNodes = args[1]
this.activeNodes = [...args[1]]
},
handleShowNodeImage() {

View File

@@ -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')

View File

@@ -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') || []

View File

@@ -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()
})
},

View File

@@ -274,7 +274,7 @@ export default {
* @Desc: 监听节点激活
*/
onNodeActive(...args) {
this.activeNodes = args[1]
this.activeNodes = [...args[1]]
},
/**