@@ -17,58 +17,59 @@ const getAsyncImports = async () => {
1717 }
1818
1919 const { default : Vue } = await import ( 'vue' )
20+ const { createPinia, PiniaVuePlugin } = await import ( 'pinia' )
2021 const { default : Vuex } = await import ( 'vuex' )
21- const { default : dashboard } = await import ( './store/dashboard.js' )
2222
2323 Vue . prototype . t = t
2424 Vue . prototype . n = n
2525 Vue . prototype . OC = OC
26+ const pinia = createPinia ( )
27+ Vue . use ( PiniaVuePlugin )
2628 Vue . use ( Vuex )
27-
2829 const store = new Vuex . Store ( {
29- modules : {
30- dashboard,
31- } ,
3230 strict : debug ,
3331 } )
3432
3533 _imports = {
36- store , Vue,
34+ pinia , Vue, store ,
3735 }
3836
3937 return _imports
4038}
4139
4240document . addEventListener ( 'DOMContentLoaded' , ( ) => {
4341 OCA . Dashboard . register ( 'deck' , async ( el ) => {
44- const { Vue, store } = await getAsyncImports ( )
42+ const { Vue, pinia , store } = await getAsyncImports ( )
4543 const { default : DashboardUpcoming } = await import ( './views/DashboardUpcoming.vue' )
4644
4745 const View = Vue . extend ( DashboardUpcoming )
4846 const vm = new View ( {
4947 propsData : { } ,
48+ pinia,
5049 store,
5150 } ) . $mount ( el )
5251 return vm
5352 } )
5453
5554 OCA . Dashboard . register ( 'deckToday' , async ( el ) => {
56- const { Vue, store } = await getAsyncImports ( )
55+ const { Vue, pinia , store } = await getAsyncImports ( )
5756 const { default : DashboardToday } = await import ( './views/DashboardToday.vue' )
5857 const View = Vue . extend ( DashboardToday )
5958 const vm = new View ( {
6059 propsData : { } ,
60+ pinia,
6161 store,
6262 } ) . $mount ( el )
6363 return vm
6464 } )
6565
6666 OCA . Dashboard . register ( 'deckTomorrow' , async ( el ) => {
67- const { Vue, store } = await getAsyncImports ( )
67+ const { Vue, pinia , store } = await getAsyncImports ( )
6868 const { default : DashboardTomorrow } = await import ( './views/DashboardTomorrow.vue' )
6969 const View = Vue . extend ( DashboardTomorrow )
7070 const vm = new View ( {
7171 propsData : { } ,
72+ pinia,
7273 store,
7374 } ) . $mount ( el )
7475 return vm
0 commit comments