xiCO2k / laravel-vue-i18n

Allows to connect your `Laravel` Framework translation files with `Vue`.
MIT License
584 stars 49 forks source link

Could you please add the example with lang/en/auth.php structure? #148

Closed taozuhong closed 9 months ago

taozuhong commented 9 months ago

Could you please add the example with php files?

import { createApp } from 'vue'
import { i18nVue } from 'laravel-vue-i18n'

createApp()
    .use(i18nVue, {
        resolve: async lang => {
            const langs = import.meta.glob('../../lang/${lang}/*.php');
            return await langs[`../../lang/${lang}/*.php`]();
        }
    })
    .mount('#app');