import Vue from 'vue' ; export const nodeIndex = Vue . extend ( { methods : { getNodeIndex ( nodeName ) { let uniqueId = this . $store . getters . getNodeIndex ( nodeName ) ; if ( uniqueId === - 1 ) { this . $store . commit ( 'addToNodeIndex' , nodeName ) ; uniqueId = this . $store . getters . getNodeIndex ( nodeName ) ; } return uniqueId . toString ( ) ; } , } , } ) ;