diff options
Diffstat (limited to 'app/assets/javascripts/registry/list/index.js')
-rw-r--r-- | app/assets/javascripts/registry/list/index.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/app/assets/javascripts/registry/list/index.js b/app/assets/javascripts/registry/list/index.js index 3d0ff327b42..e8e54fda169 100644 --- a/app/assets/javascripts/registry/list/index.js +++ b/app/assets/javascripts/registry/list/index.js @@ -4,14 +4,20 @@ import Translate from '~/vue_shared/translate'; Vue.use(Translate); -export default () => - new Vue({ - el: '#js-vue-registry-images', +export default () => { + const el = document.getElementById('js-vue-registry-images'); + + if (!el) { + return null; + } + + return new Vue({ + el, components: { registryApp, }, data() { - const { dataset } = document.querySelector(this.$options.el); + const { dataset } = el; return { registryData: { endpoint: dataset.endpoint, @@ -35,3 +41,4 @@ export default () => }); }, }); +}; |