diff --git a/README.md b/README.md index f862e81b..7a1a58b3 100644 --- a/README.md +++ b/README.md @@ -74,11 +74,18 @@ export default defineConfig({ ```ts [main.ts] import { createApp } from 'vue' +import { createRouter, createWebHistory } from 'vue-router' import ui from '@nuxt/ui/vue-plugin' import App from './App.vue' const app = createApp(App) +const router = createRouter({ + routes: [], + history: createWebHistory() +}) + +app.use(router) app.use(ui) app.mount('#app') diff --git a/docs/content/1.getting-started/2.installation/2.vue.md b/docs/content/1.getting-started/2.installation/2.vue.md index d64f99a9..d5c74fb9 100644 --- a/docs/content/1.getting-started/2.installation/2.vue.md +++ b/docs/content/1.getting-started/2.installation/2.vue.md @@ -73,13 +73,20 @@ components.d.ts #### Use the Nuxt UI Vue plugin in your `main.ts` -```ts [main.ts]{2,7} +```ts [main.ts]{3,14} import { createApp } from 'vue' +import { createRouter, createWebHistory } from 'vue-router' import ui from '@nuxt/ui/vue-plugin' import App from './App.vue' const app = createApp(App) +const router = createRouter({ + routes: [], + history: createWebHistory() +}) + +app.use(router) app.use(ui) app.mount('#app') @@ -99,11 +106,18 @@ Import the CSS file in your `main.ts`. import './assets/main.css' import { createApp } from 'vue' +import { createRouter, createWebHistory } from 'vue-router' import ui from '@nuxt/ui/vue-plugin' import App from './App.vue' const app = createApp(App) +const router = createRouter({ + routes: [], + history: createWebHistory() +}) + +app.use(router) app.use(ui) app.mount('#app') diff --git a/docs/content/1.getting-started/7.i18n/2.vue.md b/docs/content/1.getting-started/7.i18n/2.vue.md index 24f1f6b1..e1440d6f 100644 --- a/docs/content/1.getting-started/7.i18n/2.vue.md +++ b/docs/content/1.getting-started/7.i18n/2.vue.md @@ -93,12 +93,20 @@ bun add vue-i18n@10 #### Use the Vue I18n plugin in your `main.ts` -```ts [main.ts]{2,6-18,22} +```ts [main.ts]{3,14-26,29} import { createApp } from 'vue' +import { createRouter, createWebHistory } from 'vue-router' import { createI18n } from 'vue-i18n' import ui from '@nuxt/ui/vue-plugin' import App from './App.vue' +const app = createApp(App) + +const router = createRouter({ + routes: [], + history: createWebHistory() +}) + const i18n = createI18n({ legacy: false, locale: 'en', @@ -113,8 +121,7 @@ const i18n = createI18n({ } }) -const app = createApp(App) - +app.use(router) app.use(i18n) app.use(ui)