Skip to content

Commit

Permalink
docs(vue): add vue-router in installation sections
Browse files Browse the repository at this point in the history
Related to #2764
  • Loading branch information
benjamincanac committed Jan 10, 2025
1 parent 85b8553 commit 0467853
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
16 changes: 15 additions & 1 deletion docs/content/1.getting-started/2.installation/2.vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
Expand Down
13 changes: 10 additions & 3 deletions docs/content/1.getting-started/7.i18n/2.vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -113,8 +121,7 @@ const i18n = createI18n({
}
})

const app = createApp(App)

app.use(router)
app.use(i18n)
app.use(ui)

Expand Down

0 comments on commit 0467853

Please sign in to comment.