Looking for a way to display table headers in i18n format using Vue3 and TypeScript. Any help would be appreciated!
Below is the HTML code snippet:
<Datatable
:table-data="tableData"
:table-header="tableHeader"
:enable-items-per-page-dropdown="false"
:loading="isTableLoading"
:is-pagination="false"
class="activity-table"
>
.
.
. </Datatable>
And here is the corresponding script code:
import { useI18n } from "vue-i18n/index";
const { t, te } = useI18n();
const tableHeader = ref([
{
name: "Username",
key: "name",
sortable: false,
},
{
name: "Email",
key: "email",
sortable: false,
},
{
name: "Phone",
key: "phone",
sortable: false,
},
.
.
. ]);