instructions.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <div>
  3. <el-button @click="showInstructions">说明书</el-button>
  4. <div class="instructions" v-resize="onResize" v-show="isShow">
  5. <iframe
  6. id="iframeId"
  7. :src="url"
  8. frameborder="0"
  9. class="pc iframe"
  10. width="100%"
  11. :height="formeHeight"
  12. >
  13. </iframe>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. import resize from "vue-resize-directive";
  19. const defaultSettings = require("@/settings.js");
  20. export default {
  21. directives: {
  22. resize,
  23. },
  24. data() {
  25. return {
  26. url: defaultSettings.instructions+'/#g=1&p=新建乐团',
  27. isShow: false,
  28. };
  29. },
  30. mounted() {
  31. document.querySelector(".instructions")?.offsetHeight
  32. },
  33. methods: {
  34. onResize(e) {
  35. console.log(e);
  36. },
  37. showInstructions() {
  38. this.isShow = !this.isShow;
  39. },
  40. },
  41. computed: {
  42. formeHeight() {
  43. return document.querySelector(".instructions")?.offsetHeight+'px';
  44. },
  45. },
  46. };
  47. </script>
  48. <style lang="scss">
  49. .iframeId {
  50. width: 100%;
  51. }
  52. .instructions {
  53. background-color: #fff;
  54. width: 100%;
  55. position: fixed;
  56. z-index: 9999;
  57. bottom: 0;
  58. left: 0;
  59. border: 1px solid #ccc;
  60. min-height: 300px;
  61. }
  62. </style>