longyvfengyun
2024-07-31 985343d71c9a89318a16a1d0e1138bd2adf07957
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<template>
  <polygon
    :points="points"
    :stroke="color"
    :stroke-width="lineWidth"
    style="fill: none"
    :transform="'translate(' + offset.join(',') + ')'"
  />
</template>
 
<script>
export default {
  name: "",
  props: {
    len: {
      type: Number,
      default: 20,
    },
    offset: {
      type: Array,
      default() {
        return [0, 0];
      },
    },
    color: {
      type: String,
      default: "#f59a23",
    },
    lineWidth: {
      type: [Number, String],
      default: 2,
    },
  },
  computed: {
    points() {
      let len = this.len;
      let len2 = len / 2;
      return [
        [0, len2],
        [Math.cos((30 * Math.PI) / 180) * len, 0],
        [0, -len2],
      ].join(',');
    },
  },
  data() {
    return {
    };
  },
  watch: {
  },
  components: {},
  methods: {
  },
 
  mounted() {
  },
};
</script>
 
<style scoped lang="less">
// .g-rect-fill {
//   fill: none;
//   // stroke-width: 5;
//   stroke-linejoin: round;
//   stroke-linecap: round;
//   stroke-dashoffset: -100;
//   // stroke-dasharray: 3, 900;
// }
// .move {
//   stroke-width: 7;
//   // stroke-dasharray: 43, 87;
//   stroke-dasharray: 23, 107;
//   animation: lineMove 1.8s cubic-bezier(0.05, 0.1, 0.8, 1) infinite;
// }
// .move1 {
//   stroke-width: 5;
//   stroke-dasharray: 23, 107;
//   animation: lineMove 1.8s cubic-bezier(0, 0, 1, 1) infinite;
// }
// .move-dis {
//   stroke-width: 7;
//   stroke-dasharray: 23, 107;
//   animation: lineMoveDis 1.8s cubic-bezier(0.05, 0.1, 0.8, 1) infinite;
// }
// .move-dis1 {
//   stroke-width: 5;
//   stroke-dasharray: 23, 107;
//   animation: lineMoveDis 1.8s cubic-bezier(0, 0, 1, 1) infinite;
//   // &.line1 {
//   //   animation: lineMoveDis1 1.8s cubic-bezier(0, 0, 1, 1) infinite;
//   // }
// }
 
// @keyframes lineMove {
//   0% {
//     // stroke-dashoffset: -850;
//     stroke-dashoffset: -260;
//   }
//   100% {
//     stroke-dashoffset: 0;
//   }
// }
// @keyframes lineMoveDis {
//   0% {
//     // stroke-dashoffset: -850;
//     stroke-dashoffset: 260;
//   }
//   100% {
//     stroke-dashoffset: 0;
//   }
// }
</style>