Skip to content

Commit 8037053

Browse files
committed
chore: update example
1 parent 040443e commit 8037053

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

example/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,21 @@ to create a multi-variant mobile/desktop nuxt application.
1313
- Avoid adding mobile/desktop specific modules, plugins and css
1414
- Instead use [desktop/nuxt.config](./packages/desktop/nuxt.config.js) and [mobile/nuxt.config](./packages/mobile/nuxt.config.js)
1515

16-
## Pages
16+
## Pages / Layouts
1717

18-
Only top-level `pages/` directory is supported. It is best to always use a named component and implement per-variant.
18+
Only [base/pages](./packages/base/pages) and [base/layouts](./packages/base/layouts) directories are supported.
1919

20-
## Store
20+
We use named components to implement them per-variant.
2121

22-
Only top-level `store/` directory is supported. It is best to write shared logic inside vuex store modules.
22+
## Store
2323

24-
## Layout
24+
Only [base/store](./packages/base/store) directory is supported.
2525

26-
Using named components, it can be implemented with `components/AppLayout.vue` per-variant.
26+
It is best to write shared logic inside vuex store modules.
2727

2828
## Styles
2929

3030
It is recommended to use scoped styles. But in case that need to use global styles,
3131
they can be included in layout component or `nuxt.config` of each variant.
32+
33+
Also for component libraries, you can include their module in each variant.

example/packages/base/nuxt.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { nuxtConfig } from 'nuxt-extend'
22

33
export default nuxtConfig({
44
name: '@app/base',
5-
rootDir: __dirname
5+
srcDir: __dirname
66
})

example/packages/desktop/components/AppLayout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<main>
33
<Nuxt />
44
<footer>
5-
<a href="/m/">Mobile Version</a>
5+
<a href="#">Mobile Version</a>
66
</footer>
77
</main>
88
</template>

example/packages/mobile/components/AppLayout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<main>
33
<Nuxt />
44
<footer>
5-
<a href="/">Desktop Version</a>
5+
<a href="#">Desktop Version</a>
66
</footer>
77
</main>
88
</template>

example/packages/mobile/nuxt.config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@ import { nuxtConfig } from 'nuxt-extend'
22

33
export default nuxtConfig({
44
name: '@app/mobile',
5-
extends: '@app/base/nuxt.config',
6-
router: {
7-
base: '/m'
8-
}
5+
extends: '@app/base/nuxt.config'
96
})

0 commit comments

Comments
 (0)