index.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <div>
  3. <el-button size="mini" type="primary" @click="onShow">{{
  4. $t("360°画像")
  5. }}</el-button>
  6. <el-drawer
  7. :visible.sync="drawer"
  8. append-to-body
  9. size="90%"
  10. :with-header="false"
  11. >
  12. <custom
  13. :contentStyle="{ height: '100vh', width: '100vw' }"
  14. :divStyle="{ height: '100vh', width: '100vw' }"
  15. ref="custom"
  16. v-if="name === 'custom'"
  17. :id="id"
  18. />
  19. <project
  20. :contentStyle="{ height: '100vh', width: '100vw' }"
  21. :divStyle="{ height: '100vh', width: '100vw' }"
  22. ref="project"
  23. v-else-if="name === 'project'"
  24. :id="id"
  25. />
  26. <saler
  27. :contentStyle="{ height: '100vh', width: '100vw' }"
  28. :divStyle="{ height: '100vh', width: '100vw' }"
  29. ref="saler"
  30. v-else
  31. :id="id"
  32. />
  33. </el-drawer>
  34. </div>
  35. </template>
  36. <script>
  37. import custom from "./custom.vue";
  38. import project from "./project.vue";
  39. import saler from "./saler.vue";
  40. export default {
  41. props: ["id", "name"],
  42. components: {
  43. custom,
  44. project,
  45. saler,
  46. },
  47. data() {
  48. return {
  49. drawer: false,
  50. };
  51. },
  52. methods: {
  53. onShow() {
  54. this.drawer = true;
  55. this.$nextTick(() => {
  56. switch (this.name) {
  57. case "custom":
  58. console.log(this.$refs.custom);
  59. this.$nextTick(() => {
  60. this.$refs.custom.getData();
  61. });
  62. break;
  63. case "project":
  64. console.log(this.$refs.project);
  65. this.$refs.project.getData();
  66. break;
  67. default:
  68. console.log(this.$refs.saler);
  69. this.$refs.saler.getData();
  70. break;
  71. }
  72. }, 0);
  73. },
  74. },
  75. };
  76. </script>
  77. <style>
  78. </style>