index.vue 1.5 KB

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