Skip to content

Commit e68e750

Browse files
sergerdnmanager
andauthored
update nuxtjs.md, add missing dependencies and instructions (#1208)
* update nuxtjs.md, add missing dependencies and instructions * fix "[Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content." * add nuxt-i18n * add "avoid name conflicts in generators" Co-authored-by: manager <[email protected]>
1 parent 1ae053b commit e68e750

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

client-generator/nuxtjs.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,24 @@ Deployment target: Static (Static/JAMStack hosting)
3030

3131
Install required dependencies:
3232

33-
$ yarn add moment lodash vue-i18n vuelidate vuex-map-fields
33+
$ yarn add moment lodash vue-i18n vuelidate vuex-map-fields nuxt-i18n
34+
# yarn add --dev @nuxtjs/vuetify @nuxtjs/fontawesome
3435

36+
## Updating nuxtjs config
37+
38+
Update your `nuxt.config.js` with following:
39+
40+
```javascript
41+
buildModules: [
42+
// ...
43+
'@nuxtjs/vuetify',
44+
'@nuxtjs/fontawesome',
45+
'nuxt-i18n'
46+
],
47+
// ...
48+
// to avoid name conflicts in generators
49+
components: false,
50+
```
3551
## Generating Routes
3652

3753
$ npx @api-platform/client-generator https://demo.api-platform.com . --generator nuxt
@@ -95,18 +111,22 @@ Update your `layouts/default.vue` with following:
95111
</template>
96112

97113
<script>
98-
import Alert from '../components/Alert';
114+
import Alert from '../components/Alert'
99115

100116
export default {
101117
components: {
102118
Alert
103119
},
104120

105121
data: () => ({
106-
date: new Date().getFullYear(),
122+
date: null,
107123
drawer: null
108-
})
109-
};
124+
}),
125+
126+
mounted () {
127+
this.date = new Date().getFullYear()
128+
}
129+
}
110130
</script>
111131
```
112132

0 commit comments

Comments
 (0)