I am trying to create an inline modal as per documentation within a component [vue/ts/ionic 6] . However using the code in the documentation does not work because the export default defineComponent({ will throw an error:
A default export must be at the top level of a file or module declaration.
As far as I can tell, this is because Vue uses <script setup lang="ts"> does not allow an export within a component. The more I try to fix this issue (remove <script setup>, move modal to main.ts, etc.) the more I fail
Can you point me in the right direction on how to include a modal within a component without using this exportor how to do it in a different way?
That makes a lot of sense and was very helpful, thanks a lot! The modal is working well now (and some other components where I tried to use defineComponent).
The only thing I cannot get to work is the card modal on iOS. From the docs:
To create a card modal, developers need to set the presentingElement property on ion-modal.The presentingElement property accepts a reference to the element that should display under your modal. This is typically a reference to ion-router-outlet.
The code from the documentation this.presentingElement = this.$refs.page.$el; does not work for me. How can I reference the current page as presentingElement? Do you happen to have an idea here as well?