Skip to content

Commit

Permalink
[ActivityTree] #8 Fix Vue warn due avoid mutating a prop "value" dire…
Browse files Browse the repository at this point in the history
…ctly
  • Loading branch information
jjak0b committed Sep 16, 2020
1 parent 2ed1f93 commit f0ffbaf
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions editor/public/components/ActivityTreeWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export const component = {
this.redraw();
},
methods: {
notifyValue(){
console.info( "[ActivityTree]", "updating current node", this.value );
this.$emit( 'input', this.value );
notifyValue( node ){
console.info( "[ActivityTree]", "updating current node", node );
this.$emit( 'input', node );
},
get_json( id = "#") {
let jsonNode = this.tree.get_json( id, {
Expand Down Expand Up @@ -75,13 +75,11 @@ export const component = {
this.tree = null;
}

this.value = null;
this.notifyValue();
if( !jsonData ){
this.notifyValue( null );
return;
}
// open root

$( e ).jstree({
"core": {
// so that create works
Expand Down Expand Up @@ -134,8 +132,7 @@ export const component = {
},
onSelect( event, data ) {
let node = data.instance.get_node(data.selected[0]);
this.value = node;
this.notifyValue();
this.notifyValue( node );
},
// Operations
add( id, type, nodeName, nodeData ) {
Expand Down

0 comments on commit f0ffbaf

Please sign in to comment.