Skip to content
Snippets Groups Projects
dm5-topicmap-panel.vue 1.53 KiB
Newer Older
Jörg Richter's avatar
Jörg Richter committed
<template>
  <div class="dm5-topicmap-panel" v-loading="loading">
    <dm5-toolbar :comp-defs="toolbarCompDefs"></dm5-toolbar>
    <component :is="topicmapRenderer" :object="object_" :writable="writable_" :show-inmap-details="showInmapDetails_"
      :detail-renderers="detailRenderers" :context-commands="contextCommands" :quill-config="quillConfig">
Jörg Richter's avatar
Jörg Richter committed
  </div>
</template>

<script>
import { mapState } from 'vuex'

Jörg Richter's avatar
Jörg Richter committed
export default {
Jörg Richter's avatar
Jörg Richter committed
    // console.log('dm5-topicmap-panel created', this.topicmapTypes, this.$store)
    this.$store.registerModule('topicmapPanel', require('../topicmap-panel').default)
Jörg Richter's avatar
Jörg Richter committed
    this.$store.dispatch('_initTopicmapPanel', this)
  mounted () {
    // console.log('dm5-topicmap-panel mounted')
  },

  mixins: [
    require('./mixins/object').default,
    require('./mixins/writable').default,
    require('./mixins/detail-renderers').default
  props: {
    showInmapDetails: Boolean,
    toolbarCompDefs: Object,
    contextCommands: Object,
    quillConfig: Object
Jörg Richter's avatar
Jörg Richter committed
  data () {
    return {
      topicmapRenderer: undefined,
Jörg Richter's avatar
Jörg Richter committed
      // mirror props (mirroring the *dynamic* props is sufficient)
      object_:           this.object,
      writable_:         this.writable,
      showInmapDetails_: this.showInmapDetails
      // toolbarCompDefs_:  this.toolbarCompDefs   // FIXME: needed?
  computed: mapState({
    loading: state => state.topicmapPanel.loading
  components: {
    'dm5-toolbar': require('./dm5-toolbar').default
Jörg Richter's avatar
Jörg Richter committed
  }
}
</script>