mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 10:27:44 +08:00
Demo:给节点的getData方法的返回值增加默认值
This commit is contained in:
parent
74a000723b
commit
84d2a374d1
@ -70,9 +70,9 @@ export default {
|
||||
this.activeNodes = [...args[1]]
|
||||
if (this.activeNodes.length > 0) {
|
||||
let firstNode = this.activeNodes[0]
|
||||
this.link = firstNode.getData('hyperlink')
|
||||
this.link = firstNode.getData('hyperlink') || ''
|
||||
this.handleUrl(true)
|
||||
this.linkTitle = firstNode.getData('hyperlinkTitle')
|
||||
this.linkTitle = firstNode.getData('hyperlinkTitle') || ''
|
||||
} else {
|
||||
this.link = ''
|
||||
this.linkTitle = ''
|
||||
|
||||
@ -102,7 +102,7 @@ export default {
|
||||
this.activeNodes = [...args[1]]
|
||||
if (this.activeNodes.length > 0) {
|
||||
let firstNode = this.activeNodes[0]
|
||||
this.nodeImage = firstNode.getData('image')
|
||||
this.nodeImage = firstNode.getData('image') || ''
|
||||
this.iconList = firstNode.getData('icon') || [] // 回显图标
|
||||
} else {
|
||||
this.iconList = []
|
||||
|
||||
@ -75,7 +75,7 @@ export default {
|
||||
this.reset()
|
||||
if (this.activeNodes.length > 0) {
|
||||
let firstNode = this.activeNodes[0]
|
||||
let img = firstNode.getData('image')
|
||||
let img = firstNode.getData('image') || ''
|
||||
if (img) {
|
||||
if (/^https?:\/\//.test(img)) {
|
||||
this.imgUrl = img
|
||||
@ -83,7 +83,7 @@ export default {
|
||||
this.img = img
|
||||
}
|
||||
}
|
||||
this.imgTitle = firstNode.getData('imageTitle')
|
||||
this.imgTitle = firstNode.getData('imageTitle') || ''
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
|
||||
@ -55,7 +55,7 @@ export default {
|
||||
this.activeNodes = [...args[1]]
|
||||
if (this.activeNodes.length > 0) {
|
||||
let firstNode = this.activeNodes[0]
|
||||
this.note = firstNode.getData('note')
|
||||
this.note = firstNode.getData('note') || ''
|
||||
} else {
|
||||
this.note = ''
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user