Files

22 lines
745 B
TypeScript
Raw Permalink Normal View History

2024-02-24 13:22:51 +03:00
import {createApp} from 'vue';
export async function initRepoRecentCommits() {
const el = document.querySelector('#repo-recent-commits-chart');
2024-02-24 13:22:51 +03:00
if (!el) return;
2026-03-29 12:24:30 +02:00
const {default: RepoRecentCommits} = await import('../components/RepoRecentCommits.vue');
2024-02-24 13:22:51 +03:00
try {
const View = createApp(RepoRecentCommits, {
locale: {
loadingTitle: el.getAttribute('data-locale-loading-title'),
loadingTitleFailed: el.getAttribute('data-locale-loading-title-failed'),
loadingInfo: el.getAttribute('data-locale-loading-info'),
},
2024-02-24 13:22:51 +03:00
});
View.mount(el);
} catch (err) {
console.error('RepoRecentCommits failed to load', err);
el.textContent = el.getAttribute('data-locale-component-failed-to-load');
}
}