index.vue 874 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <div v-loading="loading" :style="'height:'+ height">
  3. <iframe :src="src" frameborder="no" style="width: 100%;height: 100%" scrolling="auto" />
  4. </div>
  5. </template>
  6. <script>
  7. import {exportHtml} from "@/api/infra/dbDoc";
  8. export default {
  9. name: "DBDoc",
  10. data() {
  11. return {
  12. height: document.documentElement.clientHeight - 94.5 + "px;",
  13. loading: true,
  14. src: undefined,
  15. };
  16. },
  17. mounted: function() {
  18. setTimeout(() => {
  19. this.loading = false;
  20. }, 230);
  21. const that = this;
  22. window.onresize = function temp() {
  23. that.height = document.documentElement.clientHeight - 94.5 + "px;";
  24. };
  25. },
  26. created() {
  27. exportHtml().then(response => {
  28. // var blob = new Blob(['<a id="a"><b id="b">hey!</b></a>'], {type : 'text/html'});
  29. this.src = window.URL.createObjectURL(response);
  30. })
  31. },
  32. };
  33. </script>