nuxt-modules / nuxt-modules/ionic

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

Open
#444 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
457
Forks
53
Avg merge
7h 32m
Merged PRs (30d)
21

Description

🆒 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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the customising app.vue documentation linked in the issue and reproduce the behavior with a platform-specific layouts dir configured in Nuxt. Trace how the Ionic module selects the app root and compare the proposed default-layout, ionic.vue, and configurable appIndex approaches; done means a platform-specific root can be selected without app.vue overriding layouts.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
34/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.