1

I open the popup in some root component like this:

import parentt from "./parentt.vue";
.
.
.
this.$showModal(parentt, {
  fullscreen: true,
});

This is the content of parentt.vue:

<template>
  <StackLayout>
    <label text="parent" />
    <!-- <child /> -->
  </StackLayout>
</template>

<script>
  import child from "./child.vue";
  export default {
    components: [child],
  };
</script>

<style scoped>
</style>

This is the content of child.vue:

<template>
  <StackLayout>
    <label text="child" />
  </StackLayout>
</template>

<script>
  export default {};
</script>

<style scoped></style>

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.

1 Answer 1

2

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:

<script>
  import child from "./child.vue";
  export default {
    components: {
       child
    },
  };
</script>

I recommend for detailed informations the official vue documentation

Sign up to request clarification or add additional context in comments.

3 Comments

I don't think the name really matters... the problem was with the bracket:( my heart is broken. It took 3 hours from me. Wouldn't I have gotten an error if I had used vue-debugger?
You can use for these purpose the browser console or your command line tool.
I'm not using a browser. It's a nativescript app.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.