debian-mirror-gitlab/app/assets/javascripts/mr_notes/discussion_counter.js
2023-03-05 14:24:40 +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',
},
});
},
});
}
}