Demo:给节点的getData方法的返回值增加默认值
This commit is contained in:
parent
74a000723b
commit
84d2a374d1
@ -70,9 +70,9 @@ export default {
|
|||||||
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') || ''
|
||||||
this.handleUrl(true)
|
this.handleUrl(true)
|
||||||
this.linkTitle = firstNode.getData('hyperlinkTitle')
|
this.linkTitle = firstNode.getData('hyperlinkTitle') || ''
|
||||||
} else {
|
} else {
|
||||||
this.link = ''
|
this.link = ''
|
||||||
this.linkTitle = ''
|
this.linkTitle = ''
|
||||||
|
|||||||
@ -102,7 +102,7 @@ export default {
|
|||||||
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') || ''
|
||||||
this.iconList = firstNode.getData('icon') || [] // 回显图标
|
this.iconList = firstNode.getData('icon') || [] // 回显图标
|
||||||
} else {
|
} else {
|
||||||
this.iconList = []
|
this.iconList = []
|
||||||
|
|||||||
@ -75,7 +75,7 @@ export default {
|
|||||||
this.reset()
|
this.reset()
|
||||||
if (this.activeNodes.length > 0) {
|
if (this.activeNodes.length > 0) {
|
||||||
let firstNode = this.activeNodes[0]
|
let firstNode = this.activeNodes[0]
|
||||||
let img = firstNode.getData('image')
|
let img = firstNode.getData('image') || ''
|
||||||
if (img) {
|
if (img) {
|
||||||
if (/^https?:\/\//.test(img)) {
|
if (/^https?:\/\//.test(img)) {
|
||||||
this.imgUrl = img
|
this.imgUrl = img
|
||||||
@ -83,7 +83,7 @@ export default {
|
|||||||
this.img = img
|
this.img = img
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.imgTitle = firstNode.getData('imageTitle')
|
this.imgTitle = firstNode.getData('imageTitle') || ''
|
||||||
}
|
}
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
|
|||||||
@ -55,7 +55,7 @@ export default {
|
|||||||
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') || ''
|
||||||
} else {
|
} else {
|
||||||
this.note = ''
|
this.note = ''
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user