333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
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
<template>
  <div :class="['popup-right-container']" :style="style" @click.stop>
    <header>
      <slot name="header"></slot>
    </header>
    <main>
      <slot></slot>
    </main>
    <footer>
      <slot name="footer"></slot>
    </footer>
  </div>
</template>
 
<script>
export default {
  name: "popupRight",
  props: {
    top: {
      type: String,
      required: true,
      default: "200px"
    },
    width: {
      type: String,
      required: true,
      default: "200px"
    },
    spanWidth: {
      // 右侧间隙补差
      type: Number,
      default: 0
    },
    height: {
      type: String,
      required: true,
      default: "400px"
    },
    isActive: {
      type: Boolean,
      required: true,
      default: false
    }
  },
  data() {
    return {};
  },
  computed: {
    style: function() {
      var s = {
        top: this.top,
        height: this.height,
        width: this.width,
        right: "-" + (parseInt(this.width) + this.spanWidth) + "px",
        transform:
          "translateX(-" + (this.isActive ? parseInt(this.width) : 0) + "px)",
        "-webkit-transform":
          "translateX(-" + (this.isActive ? parseInt(this.width) : 0) + "px)"
      };
      return s;
    }
  },
  methods: {}
};
</script>
 
<style lang="scss" scoped>
.popup-right-container {
  background-color: white;
  border-top: 1px solid #e4e7ed;
  border-left: 1px solid #e4e7ed;
  border-bottom: 1px solid #e4e7ed;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  position: absolute;
  background: #fff;
  transition: all 1s;
  -moz-transition: all 1s; /* Firefox 4 */
  -webkit-transition: all 1s; /* Safari and Chrome */
  -o-transition: all 1s; /* Opera */
  z-index: 3;
}
</style>