<template>
  <div v-loading="loading" element-loading-text="加载中..." style="width: 100%; height: 100%">
    <iframe
      @load="loading = false"
      style="width: 100%; height: 100%"
      :src="url"
      frameborder="0"
    ></iframe>
  </div>
</template>

<script>
export default {
  name: "PDFViewer",
  components: {},
  props: ["url"],
  data() {
    return {
      loading: true,
    };
  },
  watch: {
    url(val) {
      if (val) {
        this.loading = true;
      }
    },
  },
  methods: {},
};
</script>

<style scoped lang="scss"></style>
