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
| <script setup>
| import { ref, computed } from "vue";
| const props = defineProps({
| offset: {
| type: Array,
| default() {
| return [0, 0];
| },
| },
| width: {
| type: [Number, String],
| default: 14,
| },
| color: {
| type: String,
| default: "#804000",
| },
| });
|
| const points = computed(() => {
| return [
| [props.width / -2, 0],
| [props.width / 2, 0],
| [0, props.width],
| ];
| });
| </script>
|
| <template>
| <g ref="g" :transform="'translate(' + offset.join(',') + ')'">
| <polygon
| :points="points.join(' ')"
| :stroke="color"
| style="fill: none; stroke-width: 2"
| />
| </g>
| </template>
|
| <style scoped lang="less"></style>
|
|