| | |
| | | }, |
| | | nodeClick(data, node, nodeComp){ |
| | | if(!this.isMuti) { |
| | | //不要用watch监听value值,会找不到text |
| | | this.value = data[this.config.valueField]; |
| | | this.text = data[this.config.textField]; |
| | | this.currentNode = data; |
| | | this.$emit("setValue", { |
| | | field: this.referConfig.field, |
| | | showField: this.referConfig.showField, |
| | | value: this.value, |
| | | text: this.text, |
| | | rawData: [this.currentNode] |
| | | }); |
| | | this.setValue({checkedNodes:[data]}) |
| | | } |
| | | }, |
| | | checked:(checkedNode, checkedData)=> { |
| | | debugger; |
| | | /* |
| | | * this用时始终要报错,只能先注释 |
| | | checked(checkedNode, checkedData) { |
| | | this.setValue(checkedData) |
| | | }, |
| | | setValue:function (checkedData){ |
| | | var value = []; |
| | | var text = []; |
| | | const textSep =this.config.textSep; |
| | |
| | | text.push(tempRaw.join(textSep)); |
| | | } |
| | | this.value = value.join(','); |
| | | this.text = text.join(',')*/ |
| | | |
| | | this.value=checkedData.checkedKeys; |
| | | this.text = text.join(',') |
| | | this.$emit("setValue", { |
| | | field: this.referConfig.field, |
| | | showField: this.referConfig.showField, |
| | | value: this.value, |
| | | text: this.text, |
| | | isTreeMuti:true, |
| | | text: this.text || '', |
| | | isTreeMuti:this.isMuti, |
| | | rawData: checkedData.checkedNodes |
| | | }); |
| | | } |
| | | }, |
| | | watch:{ |
| | | } |
| | | watch:{} |
| | | } |
| | | </script> |
| | | |