Demo:不直接引用内部激活节点列表,优化性能
This commit is contained in:
parent
6b4c118a2b
commit
a404a71ba2
@ -59,7 +59,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleNodeActive(...args) {
|
handleNodeActive(...args) {
|
||||||
this.activeNodes = args[1]
|
this.activeNodes = [...args[1]]
|
||||||
if (this.activeNodes.length > 0) {
|
if (this.activeNodes.length > 0) {
|
||||||
let firstNode = this.activeNodes[0]
|
let firstNode = this.activeNodes[0]
|
||||||
this.link = firstNode.getData('hyperlink')
|
this.link = firstNode.getData('hyperlink')
|
||||||
|
|||||||
@ -52,7 +52,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleNodeActive(...args) {
|
handleNodeActive(...args) {
|
||||||
this.activeNodes = args[1]
|
this.activeNodes = [...args[1]]
|
||||||
if (this.activeNodes.length > 0) {
|
if (this.activeNodes.length > 0) {
|
||||||
let firstNode = this.activeNodes[0]
|
let firstNode = this.activeNodes[0]
|
||||||
this.iconList = firstNode.getData('icon') || []
|
this.iconList = firstNode.getData('icon') || []
|
||||||
|
|||||||
@ -92,7 +92,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleNodeActive(...args) {
|
handleNodeActive(...args) {
|
||||||
this.activeNodes = args[1]
|
this.activeNodes = [...args[1]]
|
||||||
if (this.activeNodes.length > 0) {
|
if (this.activeNodes.length > 0) {
|
||||||
let firstNode = this.activeNodes[0]
|
let firstNode = this.activeNodes[0]
|
||||||
this.nodeImage = firstNode.getData('image')
|
this.nodeImage = firstNode.getData('image')
|
||||||
|
|||||||
@ -68,7 +68,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleNodeActive(...args) {
|
handleNodeActive(...args) {
|
||||||
this.activeNodes = args[1]
|
this.activeNodes = [...args[1]]
|
||||||
},
|
},
|
||||||
|
|
||||||
handleShowNodeImage() {
|
handleShowNodeImage() {
|
||||||
|
|||||||
@ -52,7 +52,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleNodeActive(...args) {
|
handleNodeActive(...args) {
|
||||||
this.activeNodes = args[1]
|
this.activeNodes = [...args[1]]
|
||||||
if (this.activeNodes.length > 0) {
|
if (this.activeNodes.length > 0) {
|
||||||
let firstNode = this.activeNodes[0]
|
let firstNode = this.activeNodes[0]
|
||||||
this.note = firstNode.getData('note')
|
this.note = firstNode.getData('note')
|
||||||
|
|||||||
@ -69,7 +69,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleNodeActive(...args) {
|
handleNodeActive(...args) {
|
||||||
this.activeNodes = args[1]
|
this.activeNodes = [...args[1]]
|
||||||
if (this.activeNodes.length > 0) {
|
if (this.activeNodes.length > 0) {
|
||||||
let firstNode = this.activeNodes[0]
|
let firstNode = this.activeNodes[0]
|
||||||
this.tagArr = firstNode.getData('tag') || []
|
this.tagArr = firstNode.getData('tag') || []
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
:class="{ isDark: isDark }"
|
:class="{ isDark: isDark }"
|
||||||
v-if="activeNodes.length > 0"
|
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="title noTop">{{ $t('style.text') }}</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -486,7 +486,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
onNodeActive(...args) {
|
onNodeActive(...args) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.activeNodes = args[1]
|
this.activeNodes = [...args[1]]
|
||||||
this.initNodeStyle()
|
this.initNodeStyle()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@ -274,7 +274,7 @@ export default {
|
|||||||
* @Desc: 监听节点激活
|
* @Desc: 监听节点激活
|
||||||
*/
|
*/
|
||||||
onNodeActive(...args) {
|
onNodeActive(...args) {
|
||||||
this.activeNodes = args[1]
|
this.activeNodes = [...args[1]]
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user