Skip to content

Commit 32e60cf

Browse files
committed
fix(vue2): picking component in other app not working, closes #1753
1 parent 1b82544 commit 32e60cf

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

packages/app-backend-vue2/src/components/tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function getComponentParents (instance, api: DevtoolsApi, ctx: BackendCon
3434
const captureIds = new Map()
3535

3636
const captureId = vm => {
37-
const id = getUniqueId(vm)
37+
const id = vm.__VUE_DEVTOOLS_UID__ = getUniqueId(vm)
3838
if (captureIds.has(id)) return
3939
captureIds.set(id, undefined)
4040
if (vm.__VUE_DEVTOOLS_FUNCTIONAL_LEGACY__) {

packages/shell-dev-vue2/public/target.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
</head>
77
<body>
88
<div id="app"></div>
9+
<div id="app2"></div>
910
<div id="shadow"></div>
1011
<iframe src="/target-iframe.html" width="100%"></iframe>
1112
<script src="target/hook.js"></script>

packages/shell-dev-vue2/src/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ window.addEventListener('load', () => {
6767
app.$mount('#app')
6868
})
6969

70+
const app2 = new Vue({
71+
render (h) {
72+
return h('div', null, [
73+
h('h1', 'App 2'),
74+
h(Other),
75+
])
76+
},
77+
})
78+
app2.$mount('#app2')
79+
7080
// custom element instance
7181
const ce = document.querySelector('#shadow')
7282
if (ce.attachShadow) {

0 commit comments

Comments
 (0)