<template>
  <div>
    <div>role: {{role}}</div><br/>
    <TreeMenu :nodes="tree.nodes" :depth="0" :label="tree.label"></TreeMenu>
  </div>
</template>

<script>
  import TreeMenu from './TreeMenu';
  import tokenSvc from '@/common/token-service';

  let tree = {
    label: 'root',
    nodes: [
      {
        label: 'item1',
        nodes: [
          {
            label: 'item1.1'
          },
          {
            label: 'item1.2',
            nodes: [
              {
                label: 'item1.2.1'
              }
            ]
          }
        ]
      },
      {
        label: 'item2'
      }
    ]
  };
  export default {
    components: {
      TreeMenu
    },
    data() {
      return {
        tree
      };
    },
    computed: {
      role() {
        return tokenSvc.getToken().principal.authorities[0].authority;
      }
    },
    created() {
      
    }
  };
</script>
