import Vue from 'vue'; import pdfLab from '../../pdf/index.vue'; import { GlLoadingIcon } from '@gitlab/ui'; export default () => { const el = document.getElementById('js-pdf-viewer'); return new Vue({ el, components: { pdfLab, GlLoadingIcon, }, data() { return { error: false, loadError: false, loading: true, pdf: el.dataset.endpoint, }; }, methods: { onLoad() { this.loading = false; }, onError(error) { this.loading = false; this.loadError = true; this.error = error; }, }, template: `
An error occurred while loading the file. Please try again later. An error occurred while decoding the file.