debian-mirror-gitlab/app/assets/javascripts/mr_notes/discussion_counter.js
2023-03-04 22:38:38 +05:30

28 lines
665 B
JavaScript

import Vue from 'vue';
import DiscussionCounter from '~/notes/components/discussion_counter.vue';
import store from '~/mr_notes/stores';
export function initDiscussionCounter() {
const el = document.getElementById('js-vue-discussion-counter');
if (el) {
const { blocksMerge } = el.dataset;
// eslint-disable-next-line no-new
new Vue({
el,
name: 'DiscussionCounter',
components: {
DiscussionCounter,
},
store,
render(createElement) {
return createElement('discussion-counter', {
props: {
blocksMerge: blocksMerge === 'true',
},
});
},
});
}
}