<template>
  <VaTreeView
    :nodes="nodes"
    v-model:checked="selectedNodes"
    :valueBy="'id'"
    selectable
    expand-all
    :textBy="'menuTitle'"
  />
</template>

<script>
  export default {
    name: 'permissionTree',
    methods: {
      getMenuTree() {
        this.$api.getMenuTree().then((res) => {
          this.nodes = res.result.records
        })
      },
    },
    mounted() {
      this.getMenuTree()
    },
    data() {
      return {
        selectedNodes: [],
        nodes: [],
      }
    },
  }
</script>

<style scoped></style>
