Skip to content

Commit 4f69e0b

Browse files
committed
docs: Add vite example
1 parent 201c3bc commit 4f69e0b

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ or with [yarn](https://yarnpkg.com):
2525
$ yarn add laravel-vue-i18n
2626
```
2727

28-
## Usage
28+
## Installation
2929

3030
```js
3131
import { createApp } from 'vue'
@@ -38,6 +38,19 @@ createApp()
3838
.mount('#app');
3939
```
4040

41+
### With `vite`
42+
43+
The `resolve` method will need to be:
44+
45+
```js
46+
resolve: async lang => {
47+
const langs = import.meta.glob('../../lang/*.json');
48+
return await langs[`../../lang/${lang}.json`]();
49+
}
50+
````
51+
52+
### Usage
53+
4154
```html
4255
<template>
4356
<div>

0 commit comments

Comments
 (0)