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
| <script setup lang="ts">
| import {defaultProps} from "element-plus";
| import {computed} from "vue";
|
| const props = defineProps({
| type: {
| type: String,
| default: "primary"
| },
| iconClass: {
| type: String,
| default: "export"
| }
| });
| </script>
|
| <template>
| <div class="hdw-button-wrapper" :class="{'warning': type==='warning'}">
| <div class="btn-icon">
| <svg-icon :icon-class="iconClass"></svg-icon>
| </div>
| <slot></slot>
| </div>
| </template>
|
| <style scoped lang="less">
| .hdw-button-wrapper {
| user-select: none;
| display: inline-block;
| padding: 8px 12px;
| text-align: center;
| font-size: 16px;
| background-image: url("./images/primary-bg.png");
| background-size: 100% 100%;
| background-repeat: no-repeat;
| cursor: pointer;
| &:hover {
| font-weight: 700;
| }
| &:active {
| color: #0BF9FE;
| }
| &.warning {
| background-image: url("./images/warning-bg.png");
| }
| .btn-icon {
| display: inline-block;
| font-size: 20px;
| margin-right: 8px;
| }
| }
| </style>
|
|