blob: dbc466af2d2bb7ba072e83ff095ec99655abbc5e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
import Vue from 'vue';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import AbuseReportsApp from './components/app.vue';
export const initAbuseReportsApp = () => {
const el = document.querySelector('#js-abuse-reports-list-app');
if (!el) {
return null;
}
const { abuseReportsData } = el.dataset;
const { categories, reports, pagination } = convertObjectPropsToCamelCase(
JSON.parse(abuseReportsData),
{
deep: true,
},
);
return new Vue({
el,
provide: { categories },
render: (createElement) =>
createElement(AbuseReportsApp, {
props: {
abuseReports: reports,
pagination,
},
}),
});
};
|