2021-10-26 08:12:11 -04:00
|
|
|
import Vue from 'vue';
|
|
|
|
|
2021-11-05 14:12:21 -04:00
|
|
|
import TermsApp from 'jh_else_ce/terms/components/app.vue';
|
2021-10-26 08:12:11 -04:00
|
|
|
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
|
|
|
|
|
|
|
|
export const initTermsApp = () => {
|
|
|
|
const el = document.getElementById('js-terms-of-service');
|
|
|
|
|
|
|
|
if (!el) return false;
|
|
|
|
|
|
|
|
const { terms, permissions, paths } = convertObjectPropsToCamelCase(
|
|
|
|
JSON.parse(el.dataset.termsData),
|
|
|
|
{ deep: true },
|
|
|
|
);
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
provide: { terms, permissions, paths },
|
|
|
|
render(createElement) {
|
|
|
|
return createElement(TermsApp);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|