Skip to content

Commit 2d0e0d5

Browse files
committed
update main.js
1 parent 633238b commit 2d0e0d5

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

main.js

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,39 @@
11
import App from './App'
22
import store from './store'
3-
4-
// #ifndef VUE3
3+
4+
// #ifndef VUE3
55
import Vue from 'vue'
66
Vue.config.productionTip = false
7-
87
Vue.prototype.$store = store
8+
Vue.prototype.$adpid = "1111111111"
99
Vue.prototype.$backgroundAudioData = {
10-
playing: false,
11-
playTime: 0,
12-
formatedPlayTime: '00:00:00'
10+
playing: false,
11+
playTime: 0,
12+
formatedPlayTime: '00:00:00'
1313
}
14-
Vue.prototype.$adpid = "1111111111"
15-
1614
App.mpType = 'app'
17-
1815
const app = new Vue({
19-
store,
20-
...App
16+
store,
17+
...App
2118
})
2219
app.$mount()
2320
// #endif
24-
25-
// #ifdef VUE3
26-
import { createApp } from 'vue'
27-
const app = createApp(App,{})
28-
app.use(store)
29-
app.mount('#app')
30-
// #endif
21+
22+
// #ifdef VUE3
23+
import {
24+
createSSRApp
25+
} from 'vue'
26+
export function createApp() {
27+
const app = createSSRApp(App)
28+
app.use(store)
29+
app.config.globalProperties.$adpid = "1111111111"
30+
app.config.globalProperties.$backgroundAudioData = {
31+
playing: false,
32+
playTime: 0,
33+
formatedPlayTime: '00:00:00'
34+
}
35+
return {
36+
app
37+
}
38+
}
39+
// #endif

0 commit comments

Comments
 (0)