scinote-web/app/javascript/packs/vue/legacy/report_table.js
2024-12-04 13:15:45 +01:00

15 lines
583 B
JavaScript

import { createApp } from 'vue/dist/vue.esm-bundler.js';
import NativeTableRenderer from '../../../vue/reports/native_table_renderer.vue';
import { mountWithTurbolinks } from '../helpers/turbolinks.js';
window.initReportNativeTableRenderer = (id) => {
const app = createApp({});
app.config.globalProperties.i18n = window.I18n;
app.component('NativeTableRenderer', NativeTableRenderer);
mountWithTurbolinks(app, id);
};
const tables = document.querySelectorAll('.report-native-table');
tables.forEach((table) => {
window.initReportNativeTableRenderer(`#${table.id}`);
});