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
| <template>
| <div :style="styleObj"></div>
| </template>
|
| <script>
| const Directions = ["x", "y"];
| export default {
| name: "Divide",
| props: {
| direction: {
| type: String,
| default: "y",
| validator(v) {
| return Directions.includes(v);
| },
| },
| width: {
| type: String,
| default: "1px",
| },
| height: {
| type: String,
| default: "24px",
| },
| bgc: {
| type: String,
| default: "#fff",
| },
| opacity: {
| type: Number,
| default: 1,
| },
| },
| computed: {
| styleObj() {
| return {
| width: this.width,
| height: this.height,
| backgroundColor: this.bgc,
| opacity: this.opacity,
| transform: this.direction === "x" ? "rotate3d(0,0,1,90deg)" : "",
| };
| },
| },
| };
| </script>
|
|