shikeying
2023-04-07 c192f834c4e092bc7c0f2722c343c25c1be619ab
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
<!--
 * @Author: your name
 * @Date: 2022-03-25 15:45:02
 * @LastEditTime: 2022-03-31 17:06:05
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /ts-admin/src/views/components/win3/indexYear.vue
-->
<template>
  <!--动画-->
  <transition name="el-fade-in">
    <el-dialog
      center
      :title="title"
      :visible.sync="visible"
      width="800px"
      top="80px"
      :append-to-body="true"
      :destroy-on-close="true"
      @close="close"
    >
      <slot />
      <div >
        <slot name="footer" />
      </div>
    </el-dialog>
  </transition>
</template>
 
<script>
export default {
  props: {
    title: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      visible: true
    }
  },
  mounted() {
    try {
      window.onresize = function() {
        document.querySelectorAll('.cus-dialog').forEach(v => {
          v.style.width = document.querySelector('.app-main').clientWidth + 'px'
          v.style.height = '100%'
        })
      }
      window.onresize()
    } catch (e) {
      console.error(e)
    }
  },
  methods: {
    close() {
      this.visible = false
      this.$emit('close')
    }
  }
}
</script>
 
<style lang="scss" scoped>
.el-dialog__body {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding-top: 20px;
  border-radius: 20px;
}
.el-dialog {
  border-radius: 10px;
  .el-dialog__header{
    text-align: left;
    font-weight: 600;
  }
}
</style>