The Ampersand app utilizes these two components in different locations on the page. TranscriptAnnotations currently access the Vuex store.
export { default as TranscriptAnnotations } from './components/transcript_annotations'
export { default as TranscriptViewer } from './components/transcript_viewer'
TranscriptAnnotations is pulled in via ‘portal-vue’
this._portalTarget = new Vue(TranscriptAnnotations).$mount(mountPoint)
TranscriptViewer has no Vuex access yet, and is pulled in via a different custom helper method, at the heart of which is
const vueInstance = new Vue({
render: function(createElement) {
return createElement(component, { props: this.instanceProps, on: listeners, ref: 'componentInstance' })},
The Vuex instances within each are created in the same way, but when i view the Vue dev tools Vuex portion when run, only one of these Vuex states is visible (they don’t access all of the same modules which is how I can tell which is accessible.)
Vue.use(Vuex)
const store = new Vuex.Store({
modules: {
annotations : Annotations,
notifications : Notifications
}
})
export default {
store,
components {}
}
When executed, the TranscriptViewer code does not throw any errors when attempting to commit or dispatch, but it does nothing, fails silently.
So, the main question I have is to confirm if this should be possible, or if it is known that the browser can only ever have one new Vuex() instantiated witihin it on a page at any given time.