linmasahiro / vue3-table-lite

A simple and lightweight data table component for Vue.js 3. Features sorting, paging, row check, dynamic data rendering, supported TypeScript, and more.

Home Page:https://vue3-lite-table.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

labels with i18n module

bexter89 opened this issue · comments

Is it possible to pass a value to the 'label' field with the i18n module? Would love to get the table headers translated.

Hi @bexter89 ,
You can change table's label value on anytime like this example.

const table = reactive({
      isLoading: false,
      columns: [
        {
          label: i18n.t("name"),
          field: "id",
          width: "3%",
          sortable: true,
          isKey: true,
        },
      ],
      ...........
});

const switchLocale = (locale) => {
  i18n.locale = locale;
  table.columns[0].label = i18n.t("name");
}

Hi, @bexter89 , is this issue resolved now? :)

@linmasahiro yes, thank you!!