fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<template>
  <div class="diy-index"  @mouseup="handleClick">
    <el-container>
      <el-aside width="375px" class="el_aside">
        <div id="diy-aside" class="diy-aside">
          <page ref="diy-page"></page>
        </div>
        <el-button class="preview_btn" type="success" size="mini" @click="preClick">手机端预览</el-button>
      </el-aside>
      <el-main class="diy-main">
        <slot name="hotContent"></slot>
      </el-main>
    </el-container>
    <preview ref="preview"></preview>
  </div>
</template>
<script>
import page from '../../views/diy-form/page/index.vue'
import { mapState, mapMutations } from 'vuex'
import preview from '../../views/diy-form/components/preview.vue'
 
export default {
  name: 'diy-index',
  components: {
    page,
    preview
  },
  data () {
    return {
      diyDes: null
    }
  },
  computed: {
    ...mapState(['diyList'])
  },
  methods: {
    ...mapMutations(['resetDiy']),
    handleClick () {
      document.onmousemove = null
      this.$refs['diy-page'].onmouseup()
    },
    async preClick () {
      this.$emit('handle-preview')
    }
  },
  destroyed () {
    this.resetDiy()
  }
}
</script>
<style scoped lang="scss">
.diy-index{
  background: #F2F2F2;
  .diy-main{
    background-color: #ffffff;
    margin-left: 20px;
    margin-right: 20px;
  }
}
/* 设置滚动条的样式 */
.diy-aside::-webkit-scrollbar {
  display: none;
  width: 0;
}
 
.diy-aside {
  overflow: hidden;
  border: 1px solid #1F1C1C;
  height: 667px;
  overflow-y: auto;
  -ms-overflow-style:none;
  overflow:-moz-scrollbars-none;
  scrollbar-width: none;
}
.el_aside {
  text-align: center;
}
.preview_btn {
  margin-top: 10px;
  width: 375px;
  height: 50px;
  background-color: #C2A16C;
  border: none;
  &:hover,&:active,&:focus{
   background-color: #8f744a;
  }
}
</style>