? ? ? ? 這樣判空就會報錯?
loadNode(node, resolve)console.log("node")console.log(node)if (node.data !== null) {this.get(ctx + '/publicity/publicityType/typeTreeData?id=' + node.data.id).then((res) => {resolve(res)})}},
? ? ? ? 需要這樣寫,用typeof來做類型判斷
console.log("node")console.log(node)if (typeof node.data !== 'undefined') {this.get(ctx + '/publicity/publicityType/typeTreeData?id='+node.data.id).then((res) => {resolve(res)})}else {this.get(ctx + '/publicity/publicityType/typeTreeData?id='+this.typeId).then((res) => {resolve(res)})}
?
?