Skip to content
Snippets Groups Projects
quasar-tree.vue 890 B
Newer Older
schneider210's avatar
schneider210 committed
<template>
  <div class="q-pa-md q-gutter-sm">
schneider210's avatar
schneider210 committed
      :expanded.sync="expanded"
      :icon="fasCaretRight"
schneider210's avatar
schneider210 committed
      :nodes="tree"
      node-key="label"
      selected-color="grey"
      text-color="black"
schneider210's avatar
schneider210 committed
      >
    </q-tree>
  </div>
</template>

<script>
import { fasCaretRight } from '@quasar/extras/fontawesome-v5';

export default {
  name: 'Treeview',
  props: {
    manifests: Array,
    tree: Array,
  },
  data() {
    return {
      expanded: ['The Story and Proverbs of Ahikar the Wise'],
schneider210's avatar
schneider210 committed
    };
  },
  created() {
    this.fasCaretRight = fasCaretRight;
  },
  mounted() {
    this.$root.$on('update-sequence-index', (index) => {
schneider210's avatar
schneider210 committed
      this.expanded.push(this.manifests[index].label);
    });
    this.$root.$on('update-item', (item) => {
schneider210's avatar
schneider210 committed
  },
};
</script>