Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow using the layouts folder to customize the app root instead of app.vue #444

Open
Jordan-Ellis opened this issue Aug 12, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Jordan-Ellis
Copy link

Jordan-Ellis commented Aug 12, 2023

🆒 Your use case

When creating a multi platform project (e.g. with web, electron, and ionic), I need to use completely different layouts depending on the project. I do this by changing the layouts dir in my nuxt config depending on the platform I'm building for.

It seems as though you can only customize the root ionic app with the app.vue file. Since the path can't be configured, it breaks the ability to change the app root on a per platform basis. This is because nuxt seems to ignore the layouts folder entirely if there's an app.vue file in the root folder.

🆕 The solution you'd like

If a default layout is found, use that instead of the default app.vue file. Or alternatively, use a layout file called ionic.vue.

Another simple solution would be to allow configuring where nuxt ionic looks for the app.vue file. In this case I could point directly to my app index file:

// Ionic nuxt config...
ionic: {
    appIndex: 'layouts/mobile/default.vue'
}

🔍 Alternatives you've considered

I couldn't find any info on the docs on how to accomplish this: https://ionic.nuxtjs.org/cookbook/customising-app-vue

ℹ️ Additional info

@Jordan-Ellis Jordan-Ellis added the enhancement New feature or request label Aug 12, 2023
@elinardo10
Copy link

I have the same problem, after a lot of headaches I decided to abandon it for now and installed @ionic/vue inside nuxt. I'm taking full power of nuxt and using ionic. I don't know if this will work well on a native Android and iOS app. I'm still going to test it to see what the navigation behavior will be like, among other things.
Your solution seems cool, but it's not clear if you have more than one layout. example I use a layout for login auth. another for the app in general... the two don't seem to fit in this configuration

@danielroe danielroe removed their assignment Jan 9, 2024
@solmanter
Copy link

Is that any way to use multiple layouts with ionic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants