forked from vuejs/devtools-v6
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
68 lines (58 loc) · 1.36 KB
/
main.js
File metadata and controls
68 lines (58 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { createApp, h } from 'vue'
import { createRouter, createWebHashHistory } from 'vue-router'
import App from './App.vue'
import App3 from './App3.vue'
import TestPlugin from './devtools-plugin'
import SimplePlugin from './devtools-plugin/simple'
import store from './store'
// eslint-disable-next-line no-extend-native
Array.prototype.foo = 'bar'
const router = createRouter({
history: createWebHashHistory(),
routes: [
{
path: '/p1',
component: import('./router/Page1.vue'),
},
{
path: '/p2',
component: import('./router/Page2.vue'),
},
],
})
const app = createApp(App)
app.component('global', {
render: () => 'I\'m a global component',
})
app.use(router)
app.use(store)
app.use(TestPlugin)
app.mount('#app')
const app2 = createApp({
name: 'App2',
render: () => h('h1', 'App 2'),
})
app2.mount('#app2')
const app2bis = createApp({
name: 'App2',
render: () => h('h1', 'App 2 Bis'),
})
app2bis.mount('#app2bis')
createApp(App3).mount('#app3')
createApp({
render: () => h('button', {
onClick: () => app2.unmount(),
}, 'Remove app 2'),
devtools: {
hide: true,
},
}).mount('#ghost-app')
setTimeout(() => {
const app = createApp({
name: 'DelayedApp',
render: () => h('h1', 'Delayed app'),
})
app.use(SimplePlugin)
app.mount('#delay-app')
}, 1000)
window.top.document.title = 'Vue 3 Dev Shell'