I open the popup in some root component like this:
JavaScript
x
8
1
import parentt from "./parentt.vue";
2
.
3
.
4
.
5
this.$showModal(parentt, {
6
fullscreen: true,
7
});
8
This is the content of parentt.vue
:
JavaScript
1
17
17
1
<template>
2
<StackLayout>
3
<label text="parent" />
4
<!-- <child /> -->
5
</StackLayout>
6
</template>
7
8
<script>
9
import child from "./child.vue";
10
export default {
11
components: [child],
12
};
13
</script>
14
15
<style scoped>
16
</style>
17
This is the content of child.vue
:
JavaScript
1
12
12
1
<template>
2
<StackLayout>
3
<label text="child" />
4
</StackLayout>
5
</template>
6
7
<script>
8
export default {};
9
</script>
10
11
<style scoped></style>
12
Whith <child />
commented out I get a popup with text parent in it.
with <child />
being there I get a white screen.
I’m using many components in different places in my code, it’s only here in a popup that it doesn’t work.
Advertisement
Answer
You have wrong bracket in components object in parentt.vue
. Components is an object, thus use braces instead of the square brackets.
So, the correct script section looks like in parentt.vue
:
JavaScript
1
9
1
<script>
2
import child from "./child.vue";
3
export default {
4
components: {
5
child
6
},
7
};
8
</script>
9
I recommend for detailed informations the official vue documentation