Newer
Older
<div class="dm5-topicmap-panel" v-loading="loading">
<dm5-toolbar :comp-defs="toolbarCompDefs"></dm5-toolbar>
<div ref="mountElement"></div><!-- topicmap renderer mount element -->
import { mapState } from 'vuex'
// console.log('dm5-topicmap-panel created', this.topicmapTypes)
this.$store.registerModule('topicmapPanel', require('../topicmap-panel').default)
mounted () {
// console.log('dm5-topicmap-panel mounted')
this.$store.dispatch('_initTopicmapPanel', {
mixins: [
require('./mixins/object').default,
require('./mixins/object-renderers').default
],
topicmapTypes: Object,
data () {
return {
// mirror props ### FIXME: add remaining props?
object_: this.object,
writable_: this.writable
}
},
computed: mapState({
topicmapRenderer: state => state.topicmapPanel.topicmapRenderer,
loading: state => state.topicmapPanel.loading
}),
object_ () {
// console.log('object_ watcher', this.object_)
this.checkTopicmapRenderer()
writable_ () {
// console.log('writable_ watcher', this.writable_)
this.checkTopicmapRenderer()
}
},
methods: {
checkTopicmapRenderer () {
if (!this.topicmapRenderer) {
throw Error('Topicmap renderer not yet instantiated')
}
'dm5-toolbar': require('./dm5-toolbar').default