You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+69-13Lines changed: 69 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@
15
15
</p>
16
16
17
17
## Installation
18
+
18
19
With [npm](https://www.npmjs.com):
19
20
```sh
20
21
npm i laravel-vue-i18n
@@ -29,31 +30,85 @@ yarn add laravel-vue-i18n
29
30
30
31
> If you want to see a screencast on how to setup check out this video: [How to use Laravel Vue i18n plugin](https://www.youtube.com/watch?v=ONRo8-i5Qsk).
31
32
33
+
### With Vite
34
+
32
35
```js
33
36
import { createApp } from'vue'
34
37
import { i18nVue } from'laravel-vue-i18n'
35
38
36
39
createApp()
37
40
.use(i18nVue, {
38
-
resolve:lang=>import(`../../lang/${lang}.json`),
41
+
resolve:asynclang=> {
42
+
constlangs=import.meta.glob('../../lang/*.json');
43
+
returnawait langs[`../../lang/${lang}.json`]();
44
+
}
39
45
})
40
46
.mount('#app');
41
47
```
42
48
43
-
###With `vite`
49
+
#### SSR (Server Side Rendering)
44
50
45
-
The `resolve` method will need to be:
51
+
For Server Side Rendering the resolve method should not receive a `Promise` and instead take advantage of the `globEager` method like this:
0 commit comments